/* 表の見た目。白い地に、差し色1つ。 */
:root {
  --bg: #ffffff; --soft: #f6f6f9; --line: #e4e4ec; --ink: #1d1d28; --dim: #6b6b7c;
  --acc: #e0518f; --acc-ink: #ffffff; --ok: #1f9d6b; --ng: #d43d51;
  --r: 12px; --font: "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.7; }
a { color: var(--acc); text-decoration: none; }
.hide { display: none !important; }

.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.top > :first-child { justify-self: start; }
.front { grid-template-columns: auto 1fr auto; }  /* 入口の帯: 言語 ｜ 検索欄 ｜ メニュー（.bar はパスワードの強さの棒が使っている名前） */

/* 検索欄（押すと下に開く）。入っていない間は色を落として押せない */
.search { width: 100%; max-width: 560px; justify-self: center; }
.search input { border-radius: 999px; padding: 9px 18px; background: var(--soft); border-color: transparent; }
.search input:disabled { cursor: default; }
.search input:disabled::placeholder { color: #b9b9c6; }
.panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(20, 20, 40, .12); padding: 14px 16px; }
.panel h3 { margin: 0 0 8px; font-size: .8rem; color: var(--dim); font-weight: 600; }
.panel ul + h3 { margin-top: 14px; }
.panel p.none { margin: 0; color: var(--dim); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; }
.rows li { padding: 6px 8px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows li span { color: var(--dim); font-size: .85rem; margin-left: 8px; }
.rows .none { color: var(--dim); }
.brand { font-size: 1.35rem; font-weight: 700; letter-spacing: .12em; color: var(--ink); }
.me { justify-self: end; display: flex; align-items: center; gap: 8px; }
.drop { position: relative; }
.top button { white-space: nowrap; }

button { font: inherit; cursor: pointer; border-radius: 999px; padding: 8px 18px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); }
button:disabled { opacity: .5; cursor: default; }
.solid { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 600; }
.solid:hover:not(:disabled) { filter: brightness(1.06); }
.ghost:hover { background: var(--soft); }
.wide { width: 100%; padding: 11px 18px; margin-top: 6px; }
.danger { color: var(--ng); }

.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(20, 20, 40, .12);
  padding: 6px; display: grid; gap: 2px; }
.menu button { border: 0; border-radius: 8px; text-align: left; padding: 9px 12px; }
.menu button:hover { background: var(--soft); }
.menu .item { white-space: nowrap; }
.menu .item.locked { color: #b9b9c6; cursor: default; opacity: 1; }
.menu .item.locked:hover { background: transparent; }

/* 左の欄。広い形（絵＋名前が横並び）と、狭い形（絵の下に小さい名前） */
.shell { display: grid; grid-template-columns: auto 1fr auto; align-items: start; }

/* 右の枠: 宣伝と、競り */
.rcol { position: sticky; top: 77px; max-height: calc(100vh - 77px); overflow-y: auto; width: 330px; padding: 16px;
  border-left: 1px solid var(--line); display: grid; gap: 14px; }
.slot { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.slot h3 { margin: 0 0 10px; font-size: .8rem; color: var(--dim); font-weight: 600; }
.slot h3 + form, .slot form + h3, .slot .msg + h3 { margin-top: 14px; }
.ad { display: block; padding: 10px 12px; border-radius: 10px; background: var(--soft); color: var(--ink); margin: 6px 0; }
.ad:hover { background: color-mix(in srgb, var(--acc) 10%, var(--soft)); }
.ad b { display: block; font-size: .8rem; color: var(--acc); }
.ad.won { background: color-mix(in srgb, var(--acc) 10%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); }
.slot .empty { margin: 0; color: var(--dim); font-size: .88rem; }
.ad img, .ad video { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; margin-bottom: 8px; background: #000; }
.ad img { background: transparent; }
/* 絵を、掴んで持ち出す・長押しで保存する・選ぶ、を出さない */
img.nosave { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* 音声の再生機は、幅が 230 を切ると早送りの棒が潰れて点になる。枠の内側の余白まで使って幅を取る */
.ad audio { display: block; width: calc(100% + 16px); margin: 0 -8px 8px; }
.ad .ad-text { display: block; color: var(--ink); }
.media-box { margin-top: 16px; }
.media-box .lbl { display: block; font-size: .86rem; color: var(--dim); margin-bottom: 6px; }
#ad-media img, #ad-media video { display: block; width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; margin-bottom: 8px; }
#ad-media audio { display: block; width: calc(100% + 20px); margin: 0 -10px 8px; }
.media-btns { display: flex; gap: 8px; align-items: center; }
.pick { display: inline-block; cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; color: var(--ink); font-size: 1rem; }
.pick:hover { background: var(--soft); }
.slot .rule { margin: 4px 0 0; }
.span { margin: 0 0 10px; }
.span span { display: block; font-size: .78rem; color: var(--dim); }
.span b { display: block; font-size: .95rem; white-space: pre-line; }
.slot .rule + h3 { margin-top: 16px; }
.kv { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0; font-size: .88rem; color: var(--dim); }
.kv b { color: var(--ink); }
.inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.lnav { position: sticky; top: 77px; height: calc(100vh - 77px); overflow-y: auto; width: 220px; padding: 10px;
  border-right: 1px solid var(--line); }
.lnav.narrow { width: 78px; padding: 10px 6px; }
.lnav svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linejoin: round; stroke-linecap: round; }
.lnav-toggle { display: flex; border: 0; border-radius: 10px; padding: 9px 12px; margin-bottom: 4px; color: var(--dim); }
.lnav-toggle:hover { background: var(--soft); }
.lnav.narrow .lnav-toggle { margin: 0 auto 4px; }
.lnav h4 { margin: 16px 12px 4px; font-size: .76rem; color: var(--dim); font-weight: 600; }
.lnav.narrow h4 { margin: 14px 0 4px; text-align: center; font-size: .68rem; }
.lnav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 10px;
  padding: 10px 12px; margin: 2px 0; background: transparent; color: var(--ink); font-size: .95rem; text-align: left; text-decoration: none; }
.lnav-item:hover { background: var(--soft); }
.lnav-item.on { background: color-mix(in srgb, var(--acc) 12%, transparent); color: var(--acc); font-weight: 600; }
.lnav-item:disabled { opacity: 1; }
.lnav-item.locked { color: #b9b9c6; cursor: default; }
.lnav-item.locked:hover { background: transparent; }
.lnav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lnav.narrow .lnav-item { flex-direction: column; gap: 3px; padding: 9px 2px; font-size: .68rem; text-align: center; }
.lnav.narrow .lnav-item span { max-width: 100%; }

.hero { max-width: 760px; margin: 0 auto; padding: 14vh 20px 10vh; text-align: center; }
.hero h1 { font-size: clamp(2.4rem, 8vw, 4.2rem); letter-spacing: .14em; margin: 0 0 12px; }
.hero p { font-size: 1.05rem; margin: 6px 0; }
.hero .sub { color: var(--dim); font-size: .95rem; }

/* 道具（左の欄から開く。入口の文の代わりに真ん中に出る） */
.tool { min-width: 0; padding: 16px 20px 40px; }
.tg-bar { display: grid; gap: 8px; }
.tg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: relative; }
.tg-q { flex: 1 1 260px; border-radius: 999px; padding: 9px 18px; background: var(--soft); border-color: transparent; }
.tg-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.tg-seg button { border: 0; border-radius: 0; padding: 7px 14px; }
.tg-seg button.on { background: var(--acc); color: var(--acc-ink); }
.tg-lbl { font-size: .8rem; color: var(--dim); }
.tg-src { display: inline-flex; align-items: center; gap: 2px; font-size: .9rem; color: var(--ink); }
.tg-src input { width: auto; margin: 0 2px 0 0; accent-color: var(--acc); }
.tg-pager { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.tg-page { font-size: .82rem; color: var(--dim); white-space: nowrap; }
.tg-notes { display: flex; flex-wrap: wrap; gap: 4px 16px; min-height: 1.4em; margin: 6px 0 10px; font-size: .8rem; color: var(--dim); }
.tg-hint { color: var(--dim); margin: 40px 0; text-align: center; }
.tg-ac { position: absolute; left: 0; top: calc(100% + 6px); z-index: 3; min-width: 280px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: 0 10px 30px rgba(20, 20, 40, .12); padding: 6px; }
.tg-ac-row { display: flex; justify-content: space-between; gap: 14px; padding: 5px 10px; border-radius: 8px; cursor: pointer;
  font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
.tg-ac-row.on, .tg-ac-row:hover { background: var(--soft); }
.tg-ac-count { color: var(--dim); font-size: .78rem; }
.tg-ac-hint { padding: 4px 10px 2px; font-size: .72rem; color: var(--dim); }
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tg-item { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--soft); }
.tg-item:hover { border-color: var(--acc); }
.tg-cover, .tg-nocover { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tg-nocover { display: grid; place-items: center; color: var(--dim); font-size: .8rem; }
.tg-badge { position: absolute; left: 6px; top: 6px; font-size: .68rem; padding: 1px 7px; border-radius: 999px; background: rgba(29, 29, 40, .72); color: #fff; }
.tg-rating { position: absolute; right: 6px; top: 6px; font-size: .66rem; padding: 1px 6px; border-radius: 999px; color: #fff; background: #6b6b7c; }
.tg-rating.r-g, .tg-rating.r-s { background: var(--ok); }
.tg-rating.r-q { background: #e08a2e; }
.tg-rating.r-e { background: var(--ng); }
.tg-cap { padding: 5px 8px; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--bg); }
.tg-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; outline: 0; }
.tg-stage { position: relative; min-height: 240px; max-height: 78vh; display: grid; place-items: center; background: var(--soft);
  border-radius: var(--r); overflow: hidden; cursor: pointer; }
.tg-big { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; }
.tg-nopic { padding: 60px 20px; color: var(--dim); text-align: center; }
.tg-num { position: absolute; right: 10px; bottom: 8px; font-size: .74rem; padding: 1px 8px; border-radius: 999px; background: rgba(29, 29, 40, .72); color: #fff; }
.tg-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-tools .ghost, .tg-tools .solid { padding: 6px 12px; font-size: .86rem; }
.tg-open { border: 1px solid var(--line); border-radius: 999px; color: var(--ink); }
.tg-groups { display: grid; gap: 10px; margin-top: 8px; }
.tg-ghead { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--dim); font-weight: 600; }
.tg-ghead i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tg-gcopy { border: 0; background: transparent; padding: 0 4px; font-size: .9rem; line-height: 1; }
.tg-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tg-chip { border: 1px solid color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 10%, var(--bg));
  border-radius: 999px; padding: 2px 9px; font-size: .8rem; font-family: ui-monospace, Consolas, monospace; color: var(--ink); }
.tg-chip:hover { background: color-mix(in srgb, var(--c) 22%, var(--bg)); }
.tg-chip.on { background: var(--c); color: #fff; border-color: var(--c); }
.tg-chip.bl { opacity: .45; text-decoration: line-through; cursor: default; }
.tg-meta { font-size: .76rem; color: var(--dim); font-family: ui-monospace, Consolas, monospace; margin: 6px 0 0; }
.tg-ta { width: 100%; min-height: 220px; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: .86rem; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.tg-form { display: grid; gap: 10px; }
.tg-check { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.tg-check input { width: auto; accent-color: var(--acc); }
.card .tg-row { justify-content: flex-end; margin-top: 12px; }
/* 画像生成（tensor の「画像作成」の並び: 左に モデル・LoRA・設定、右上に 言葉と生成、右下に 履歴） */
.gn { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.gn-left { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); display: flex; flex-direction: column; max-height: calc(100vh - 140px); }
.gn-tabs { display: flex; gap: 14px; padding: 12px 16px 0; border-bottom: 1px solid var(--line); }
.gn-tab { border: 0; border-radius: 0; background: transparent; padding: 6px 2px 10px; font-weight: 600; color: var(--dim); }
.gn-tab.on { color: var(--acc); box-shadow: inset 0 -2px 0 var(--acc); }
.gn-tab:disabled { opacity: .5; }
.gn-scroll { overflow: auto; padding: 12px 16px 6px; display: grid; gap: 10px; }
.gn-h { margin: 6px 0 0; font-size: .95rem; }
.gn-lbl { font-size: .84rem; color: var(--dim); }
.gn-card, .gn-lora, .gn-pick-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); text-align: left; width: 100%; }
.gn-card { cursor: pointer; } .gn-card:hover, .gn-pick-row:hover { border-color: var(--acc); }
.gn-pic { width: 60px; height: 60px; flex: 0 0 auto; border-radius: 10px; background: var(--soft); display: grid; place-items: center; overflow: hidden; color: var(--dim); }
.gn-pic.small { width: 44px; height: 44px; }
.gn-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gn-mbody { flex: 1 1 auto; min-width: 0; }
.gn-badge { display: inline-block; font-size: .66rem; padding: 1px 6px; border-radius: 4px; background: var(--soft); color: var(--dim); margin-bottom: 3px; }
.gn-badge.lora { background: #f3e2c6; color: #7a5a1e; }
.gn-mname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-sub { font-size: .78rem; color: var(--dim); }
.gn-chev { color: var(--dim); font-size: 1.2rem; }
.gn-loras { display: grid; gap: 8px; }
.gn-lhead { display: flex; align-items: center; gap: 8px; } .gn-lname { flex: 1 1 auto; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-weight { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.gn-weight input[type=range] { flex: 1 1 auto; accent-color: var(--acc); }
.gn-pm { border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; height: 26px; line-height: 1; background: var(--bg); }
.gn-adds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gn-add { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--bg); font-weight: 600; font-size: .9rem; }
.gn-add.wide { grid-column: 1 / -1; width: 100%; } .gn-add:disabled { opacity: .5; }
.gn-row { display: grid; gap: 6px; } .gn-row.between { display: flex; align-items: center; justify-content: space-between; }
.gn-row.soon .gn-lbl { color: var(--ink); }
.gn-left select { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; }
.gn-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gn-size { display: grid; justify-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; background: var(--bg); font-size: .78rem; }
.gn-size i { font-style: normal; font-size: .9rem; } .gn-size small { color: var(--dim); font-size: .66rem; }
.gn-size.on { border-color: var(--acc); color: var(--acc); background: color-mix(in srgb, var(--acc) 6%, var(--bg)); }
.gn-wh, .gn-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gn-slider { display: grid; gap: 4px; } .gn-slider-top { display: flex; align-items: center; justify-content: space-between; }
.gn-num { width: 74px; padding: 4px 8px; font-size: .86rem; }
.gn-range { width: 100%; accent-color: var(--acc); }
.gn-switch { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--dim); } .gn-switch input { width: auto; accent-color: var(--acc); }
.gn-seed { display: flex; gap: 6px; } .gn-seed input[type=text] { flex: 1 1 auto; }
.gn-dice { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 12px; }
.gn-more { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; background: transparent; padding: 8px 0; font-weight: 600; font-size: .9rem; }
.gn-more i { font-style: normal; transition: transform .15s; } .gn-more.open i { transform: rotate(180deg); }
.gn-morebox { display: grid; gap: 8px; padding-bottom: 6px; }
.gn-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.gn-foot-b { border: 0; background: transparent; padding: 6px 4px; font-size: .78rem; color: var(--ink); border-radius: 8px; }
.gn-foot-b:hover { background: var(--soft); } .gn-foot-b:disabled { opacity: .5; }
.gn-right { display: grid; gap: 14px; min-width: 0; }
.gn-prompt { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; background: var(--bg); }
.gn-ta { position: relative; }
.gn-ta textarea { width: 100%; border: 0; resize: vertical; padding: 4px 28px 4px 4px; font: inherit; line-height: 1.55; background: transparent; }
.gn-ta textarea:focus { outline: 0; }
.gn-neg { color: var(--dim); border-top: 1px dashed var(--line) !important; }
.gn-x { position: absolute; right: 2px; top: 2px; border: 0; background: transparent; color: var(--dim); padding: 2px 6px; font-size: .95rem; }
.gn-lhead .gn-x { position: static; }
.gn-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.gn-tool { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 4px 6px; border-radius: 8px; font-size: .86rem; color: var(--dim); }
.gn-tool.on { color: var(--acc); } .gn-tool.ic { font-size: .95rem; } .gn-tool:disabled { opacity: .5; }
.gn-check { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; } .gn-check input { width: auto; accent-color: var(--acc); } .gn-check.soon { color: var(--dim); }
.gn-sp { flex: 1 1 auto; }
.gn-n { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.gn-go { height: 42px; padding: 0 22px; border: 0; border-radius: 10px; color: #fff; font-weight: 700; background: linear-gradient(90deg, #4f7cff, #2fd7a2); }
.gn-go.off { background: linear-gradient(90deg, #8d9bc4, #8fc9b8); }   /* ランプが緑でない間は沈める */
.gn-lamp { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); font-size: .84rem; font-weight: 600; color: var(--ink); }
.gn-lamp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ng); box-shadow: 0 0 8px rgba(212, 61, 81, .6); }
.gn-lamp.yellow .gn-lamp-dot { background: #f2b134; box-shadow: 0 0 8px rgba(242, 177, 52, .6); animation: cf-blink 1.2s infinite; }
.gn-lamp.green .gn-lamp-dot { background: var(--ok); box-shadow: 0 0 8px rgba(31, 157, 107, .6); }
.gn-go b { font-weight: 600; opacity: .9; }
.gn-hist { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); min-height: 320px; }
.gn-hbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.gn-htabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--soft); }
.gn-htab { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: .86rem; color: var(--dim); }
.gn-htab.on { background: #1d1d28; color: #fff; } .gn-htab:disabled:not(.on) { opacity: .6; }
.gn-views { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--soft); }
.gn-view { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; color: var(--dim); } .gn-view.on { background: #1d1d28; color: #fff; }
.gn-hbtns { display: flex; gap: 6px; margin-left: auto; }
.gn-hb { border: 1px solid var(--line); background: var(--bg); padding: 6px 12px; border-radius: 10px; font-size: .84rem; } .gn-hb:disabled { opacity: .5; }
.gn-items { padding: 12px; display: grid; gap: 10px; }
.gn-items.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gn-item { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gn-items.list .gn-item { grid-template-columns: 64px 1fr; align-items: center; padding: 6px; }
.gn-ipic { aspect-ratio: 1; background: var(--soft); display: grid; place-items: center; color: var(--dim); }
.gn-items.list .gn-ipic { width: 64px; height: 64px; border-radius: 8px; }
.gn-ibody { padding: 0 8px 8px; min-width: 0; } .gn-items.list .gn-ibody { padding: 0 8px; }
.gn-iname { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-empty { grid-column: 1 / -1; display: grid; place-items: center; gap: 6px; padding: 60px 20px; color: var(--dim); }
.gn-empty-ic { font-size: 2rem; }
.gn-picker { width: min(420px, 94vw); display: grid; gap: 10px; }
.gn-paste { width: min(560px, 94vw); display: grid; gap: 10px; }
.gn-paste-ta { width: 100%; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: .86rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.gn-pick-h { display: flex; align-items: center; justify-content: space-between; } .gn-pick-h h3 { margin: 0; } .gn-pick-h .gn-x { position: static; font-size: 1.1rem; }
.gn-pick-list { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
@media (max-width: 900px) { .gn { grid-template-columns: 1fr; } .gn-left { max-height: none; } }

/* ComfyUI ― 一覧（tensorhub の /workflow の並び: 大きなボタン 2 つ、マイワークフローの行） */
.cf-title { margin: 0 0 14px; font-size: 1.3rem; }
.cf-top { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin: 0 auto 22px; }
.cf-big { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--soft); font-weight: 600; }
.cf-big:hover { border-color: var(--acc); }
.cf-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-style: normal; font-size: 1rem; }
.cf-dot.plus { background: #e85d2a; } .cf-dot.imp { background: var(--ok); }
.cf-mine { margin: 0 0 8px; font-size: .9rem; color: var(--dim); font-weight: 600; }
.cf-list { display: grid; gap: 8px; }
.cf-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); cursor: pointer; }
.cf-row:hover { border-color: var(--acc); }
.cf-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #1d1d28; color: #fff; font-weight: 700; }
.cf-body { flex: 1 1 auto; min-width: 0; }
.cf-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-sub { font-size: .8rem; color: var(--dim); }
.cf-more { border: 0; background: transparent; padding: 4px 10px; font-size: 1.1rem; }
.cf-menu { position: absolute; right: 12px; top: 44px; z-index: 4; display: grid; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 20, 40, .12); padding: 4px; min-width: 140px; }
.cf-menu button { border: 0; border-radius: 8px; text-align: left; padding: 8px 12px; background: transparent; }
.cf-menu button:hover { background: var(--soft); } .cf-menu button.ng { color: var(--ng); }
/* ComfyUI ― 編集の画面（画面全体を覆う。本家の画面を窓で出し、殻は暗い色＝見本と同じ） */
body.cf-open { overflow: hidden; }
.cf-ed { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #1b1b1f; color: #e8e8ec; --cf-line: #2e2e36; --cf-panel: #232329; }
.cf-ed button { color: inherit; }
.cf-ed-top { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 14px; border-bottom: 1px solid var(--cf-line); background: #1b1b1f; }
.cf-ed-title { flex: 1 1 auto; min-width: 0; }
.cf-ed-nmrow { display: flex; align-items: center; gap: 6px; }
.cf-ed-name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; }
.cf-pen { color: #9a9aa6; font-size: .9rem; }
.cf-ed-state { font-size: .72rem; color: #9a9aa6; }
.cf-ed-right { display: flex; align-items: center; gap: 8px; }
.cf-ed svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.cf-ico { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--cf-line); background: var(--cf-panel); padding: 0; color: #e8e8ec; transition: background .12s, border-color .12s; }
.cf-ico:hover:not(:disabled) { background: #2c2c34; border-color: #3a3a44; }
.cf-ico.small { width: 30px; } .cf-ico.wide { width: auto; padding: 0 14px; font-size: .9rem; font-weight: 600; }
.cf-ico.back { background: transparent; }
.cf-group { display: inline-flex; border: 1px solid var(--cf-line); border-radius: 12px; overflow: hidden; background: var(--cf-panel); }
.cf-group .cf-ico.in-group { border: 0; border-radius: 0; background: transparent; }
.cf-group .cf-ico.in-group + .cf-ico.in-group { border-left: 1px solid var(--cf-line); }
.cf-group .cf-ico.in-group:hover:not(:disabled) { background: #2c2c34; }
.cf-ico:disabled, .cf-share:disabled, .cf-pill-b:disabled, .cf-rail-b:disabled { opacity: .45; cursor: default; }
.cf-share { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 0; background: linear-gradient(135deg, #ff6a2a, #e8481a); color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(232, 72, 26, .35); }
.cf-share:hover:not(:disabled) { filter: brightness(1.08); }
.cf-pen svg { stroke: #9a9aa6; }
.cf-ed-body { flex: 1 1 auto; display: flex; min-height: 0; }
.cf-rail { width: 40px; display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 6px; border-right: 1px solid var(--cf-line); background: #1b1b1f; }
.cf-rail-bottom { margin-top: auto; display: grid; gap: 6px; }
.cf-rail-b { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; padding: 0; color: #9a9aa6; }
.cf-rail-b:hover:not(:disabled) { color: #fff; background: var(--cf-panel); }
.cf-rail-b.on { color: #fff; box-shadow: inset 3px 0 0 #4d8dff; }
.cf-rail-b svg { width: 20px; height: 20px; }
.cf-lib { display: none; width: 310px; flex: 0 0 310px; flex-direction: column; border-right: 1px solid var(--cf-line); background: #1b1b1f; min-height: 0; }
.cf-ed.lib-open .cf-lib { display: flex; }
.cf-lib-h { padding: 14px 14px 8px; font-weight: 600; font-size: .95rem; }
.cf-lib-s { padding: 0 14px 10px; }
.cf-lib-s input { width: 100%; background: #1b1b1f; color: #fff; border: 1px solid #3a3a44; border-radius: 10px; padding: 9px 12px; }
.cf-lib-list { flex: 1 1 auto; overflow: auto; padding: 6px 8px 20px; }
.cf-folder-h { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 9px 8px; text-align: left; border-radius: 8px; font-size: .95rem; }
.cf-folder-h:hover { background: var(--cf-panel); }
.cf-arrow { font-style: normal; color: #9a9aa6; transition: transform .15s; } .cf-folder.open .cf-arrow { transform: rotate(90deg); }
.cf-fname { flex: 1 1 auto; } .cf-count { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: #2f2f39; color: #cfcfd8; font-weight: 600; }
.cf-nodes { display: none; padding: 0 0 4px 26px; } .cf-folder.open .cf-nodes { display: grid; }
.cf-node { border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 6px; font-size: .86rem; color: #d6d6de; }
.cf-node:hover { background: var(--cf-panel); color: #fff; }
.cf-stage { position: relative; flex: 1 1 auto; min-width: 0; }
.cf-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #1b1b1f; }
.cf-ed-bottom { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; }
.cf-pill { display: flex; gap: 4px; padding: 6px; border-radius: 14px; background: #26262c; border: 1px solid var(--cf-line); }
.cf-pill-b { display: grid; justify-items: center; gap: 3px; border: 0; background: transparent; padding: 6px 14px; border-radius: 10px; font-size: .72rem; color: #d6d6de; }
/* 実行: ランプの点を中に持つ1つのボタン。緑＝見本と同じ橙、赤・黄＝器と同じ黒で沈める（主 2026-10-07「なんかださい」→ 2箱を1つに） */
/* 実行: ランプの点を中に持つ1つのボタン（形は 07:29 の物。主「形は良い、色がへん」）。赤・黄の間は上の器のボタン（履歴など）と同じ黒・同じ白い字、緑で見本の橙 */
.cf-run { position: relative; display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 30px 0 22px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: 1.05rem; color: #fff; background: linear-gradient(90deg, #ff5a1f, #ff8a3d); box-shadow: 0 8px 24px rgba(255, 90, 31, .35); transition: background .25s, box-shadow .25s; }
/* 主の選び（2026-10-07 A案）: ボタンは赤・黄・緑どの時も見本の橙のまま。状態はランプの点の色だけで言う */
/* GPU のランプ（主の決め: 赤＝契約なし・黄＝起き上がり中・緑＝焼ける）と実行の列の数。実行のすぐ左、同じ器の重さ */
.cf-lamp-dot { width: 10px; height: 10px; border-radius: 50%; background: #d43d51; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25), 0 0 10px rgba(212, 61, 81, .9); flex: none; }   /* ランプの点（字の左）。薄い黒の輪で橙の上でも見える。赤＝契約なし */
.cf-run.yellow .cf-lamp-dot { background: #f2b134; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25), 0 0 10px rgba(242, 177, 52, .9); animation: cf-blink 1.2s infinite; }   /* 黄（点滅）＝起き上がり中 */
.cf-run.green .cf-lamp-dot { background: #2fd7a2; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25), 0 0 10px rgba(47, 215, 162, .9); }   /* 緑＝焼ける */
.cf-lamp-q { position: absolute; top: -9px; right: -9px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: #fff; color: #1f1f24; border: 3px solid #1b1b1f; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; }   /* 実行待ちの数。1 以上の時だけ右上に出る */
@keyframes cf-blink { 50% { opacity: .35; } }
.cf-run svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.cf-run > span:not(.cf-lamp-q) { line-height: 1; }   /* 字の行の箱を字の高さに合わせる。合わせないと ▶ が字より上にずれる（主 2026-10-07 指摘） */
.cf-zoom { position: absolute; right: 16px; bottom: 60px; display: grid; gap: 2px; padding: 4px; border-radius: 12px; background: #26262c; border: 1px solid var(--cf-line); }
.cf-zoom button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; padding: 0; color: #d6d6de; }
.cf-zoom button:hover { background: var(--cf-panel); color: #fff; }
.cf-hseg-b { display: inline-flex; align-items: center; justify-content: center; }
.cf-vbtn { display: inline-flex; align-items: center; gap: 6px; } .cf-vbtn svg, .cf-vdel svg { width: 16px; height: 16px; }
.cf-vdel { display: inline-flex; align-items: center; }
.cf-note { position: absolute; right: 16px; top: 16px; max-width: 60%; padding: 10px 14px; border-radius: 10px; background: #2b2024; color: #ff8a80; border: 1px solid #4a2a2a; font-size: .86rem; }
.cf-ico.on { border-color: #ff5a1f; color: #ff8a3d; }
.cf-ed.dialog-open .cf-ed-bottom, .cf-ed.dialog-open .cf-zoom, .cf-ed.dialog-open .cf-note, .cf-ed.dialog-open .cf-hist { display: none; }   /* 窓の中の本家の窓が開いている間 */
.cf-toast { position: absolute; left: 50%; top: 72px; transform: translate(-50%, -10px); z-index: 8; padding: 10px 18px; border-radius: 10px; background: #2b2b33; color: #fff; border: 1px solid var(--cf-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-size: .9rem; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.cf-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 保存した版の一覧（保存▾） */
.cf-ed-right { position: relative; }
.cf-vmenu { position: absolute; right: 0; top: 46px; z-index: 5; width: 360px; max-width: 80vw; background: var(--cf-panel); border: 1px solid var(--cf-line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); padding: 8px; }
.cf-vmenu-h { font-size: .78rem; color: #9a9aa6; padding: 4px 8px 8px; }
.cf-vlist { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.cf-vrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; } .cf-vrow:hover { background: #2c2c34; }
.cf-vtime { flex: 1 1 auto; font-size: .86rem; font-family: ui-monospace, Consolas, monospace; }
.cf-vbtn { border: 0; background: transparent; padding: 4px 8px; border-radius: 6px; font-size: .82rem; color: #d6d6de; } .cf-vbtn:hover { background: #3a3a44; }
.cf-vdel { border: 0; background: transparent; padding: 4px 6px; color: #9a9aa6; } .cf-vdel:hover { color: #ff8a80; }
.cf-vnote { margin: 4px 8px 8px; font-size: .8rem; color: #9a9aa6; }
/* 履歴の板（右） */
.cf-hist { position: absolute; right: 12px; top: 12px; bottom: 12px; width: 300px; max-width: 70%; display: flex; flex-direction: column; background: var(--cf-panel); border: 1px solid var(--cf-line); border-radius: 12px; overflow: hidden; }
.cf-hbar { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--cf-line); }
.cf-hseg { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: #1b1b1f; }
.cf-hseg-b { border: 0; background: transparent; width: 32px; height: 28px; border-radius: 6px; color: #d6d6de; padding: 0; } .cf-hseg-b.on { background: #ff5a1f; color: #fff; } .cf-hseg-b.right { margin-left: auto; } .cf-hseg-b:disabled { opacity: .45; }
.cf-hbody { flex: 1 1 auto; overflow: auto; padding: 10px; display: grid; gap: 10px; align-content: start; }
.cf-hbody.grid { grid-template-columns: 1fr 1fr; } .cf-hbody.list { grid-template-columns: 1fr; }
.cf-hitem { border: 1px solid var(--cf-line); border-radius: 10px; overflow: hidden; font-size: .74rem; }
.cf-hhead { display: flex; justify-content: space-between; padding: 6px 8px; color: #9a9aa6; }
.cf-hpic { aspect-ratio: 3 / 4; display: grid; place-items: center; background: #1b1b1f; color: #9a9aa6; }
.cf-hempty { grid-column: 1 / -1; display: grid; place-items: center; gap: 6px; padding: 40px 10px; color: #9a9aa6; text-align: center; font-size: .86rem; } .cf-hempty-ic { font-size: 2rem; }
.cf-hnote { margin: 0; padding: 8px 10px; border-top: 1px solid var(--cf-line); font-size: .74rem; color: #ff8a80; }
/* ページの中の窓（名前を付ける・確かめる。見本の「重複」の窓の形） */
.cf-modal-veil { position: fixed; z-index: 70; }
.cf-ed .cf-modal-veil { position: absolute; }
.cf-modal { width: min(620px, 92%); background: #26262c; color: #e8e8ec; border: 1px solid #2e2e36; border-radius: 16px; padding: 20px 24px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.cf-modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; } .cf-modal-h h3 { margin: 0; font-size: 1.2rem; }
.cf-modal-h .cf-ico { background: transparent; border-color: transparent; color: #cfcfd8; }
.cf-modal-p { margin: 0 0 14px; color: #cfcfd8; line-height: 1.6; }
.cf-modal-in { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #3a3a44; background: #333339; color: #fff; font: inherit; font-size: 1rem; }
.cf-modal-in:focus { outline: 2px solid rgba(255, 90, 31, .5); border-color: #ff5a1f; }
.cf-modal-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.cf-modal-b { padding: 9px 20px; border-radius: 999px; border: 1px solid #3a3a44; background: #2c2c34; color: #fff; font-weight: 600; }
.cf-modal-b.ok { background: #ff5a1f; border-color: #ff5a1f; } .cf-modal-b.ok.danger { background: #d43d51; border-color: #d43d51; }
/* 共有の窓 */
.cf-veil { position: absolute; inset: 0; z-index: 7; background: rgba(0, 0, 0, .55); display: grid; place-items: center; }
.cf-share-win { width: min(900px, 94%); background: var(--cf-panel); border: 1px solid var(--cf-line); border-radius: 16px; padding: 18px 22px 24px; }
.cf-share-h { display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 18px; } .cf-share-h h3 { margin: 0; font-size: 1.05rem; } .cf-share-h .cf-ico { position: absolute; right: 0; top: -4px; }
.cf-share-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cf-share-win.one { width: min(520px, 94%); } .cf-share-cards.one { grid-template-columns: 1fr; }
.cf-share-pic svg { stroke: #9a9aa6; }
.cf-share-card { display: grid; justify-items: center; gap: 10px; padding: 22px 18px; border-radius: 14px; background: #1b1b1f; border: 1px solid var(--cf-line); text-align: center; }
.cf-share-pic { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; font-size: 3rem; border-radius: 10px; background: #26262c; }
.cf-share-card h4 { margin: 0; font-size: 1.1rem; } .cf-share-card p { margin: 0; font-size: .82rem; color: #b8b8c2; line-height: 1.6; }
.cf-share-b { margin-top: 8px; padding: 10px 22px; border-radius: 10px; border: 1px solid #3a3a44; background: transparent; color: #fff; font-weight: 600; } .cf-share-b:disabled { opacity: .45; }
@media (max-width: 760px) { .cf-share-cards { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cf-top { grid-template-columns: 1fr; } .cf-lib { width: 240px; flex-basis: 240px; } .cf-ed-right .cf-ico.wide { display: none; } }


/* 窓は、上の帯より手前に出す。中身が画面より長い時は上から始めて、窓の中を巻いて見られる様にする（真ん中寄せのままだと上が切れる） */
.veil { position: fixed; inset: 0; background: rgba(25, 25, 40, .45); display: grid; justify-items: center; align-items: start;
  padding: 16px; overflow: auto; z-index: 20; }
.card { position: relative; width: 100%; max-width: 440px; margin: auto; background: var(--bg); border-radius: 18px;
  padding: 26px 24px 22px; box-shadow: 0 20px 60px rgba(20, 20, 40, .25); }
.x { position: absolute; right: 12px; top: 12px; border: 0; padding: 6px 10px; color: var(--dim); }
h2 { margin: 0 0 14px; font-size: 1.15rem; }

.tabs { display: flex; gap: 6px; margin: 0 28px 16px 0; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-radius: 0; padding: 8px 12px; color: var(--dim); border-bottom: 2px solid transparent; }
.tabs .on { color: var(--acc); border-bottom-color: var(--acc); font-weight: 600; }

form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: .86rem; color: var(--dim); }
input { font: inherit; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); width: 100%; }
input:focus { outline: 2px solid color-mix(in srgb, var(--acc) 45%, transparent); border-color: var(--acc); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 8px; margin: 0; }
legend { font-size: .82rem; color: var(--acc); padding: 0 6px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row3 input { text-align: center; letter-spacing: .08em; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.hint { font-size: .8rem; color: var(--dim); margin: 6px 0 0; }
.msg { min-height: 1.3em; margin: 0; font-size: .86rem; color: var(--ng); }
.msg.ok { color: var(--ok); }
.bar { height: 5px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ng); transition: width .2s; }
.bar i.s1 { width: 20%; } .bar i.s2 { width: 40%; background: #e08a2e; } .bar i.s3 { width: 60%; background: #d6b72a; }
.bar i.s4 { width: 80%; background: #6fb536; } .bar i.s5 { width: 100%; background: var(--ok); }

.list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; font-family: ui-monospace, Consolas, monospace; }
.list li.open { cursor: pointer; }
.list li.open:hover { background: var(--soft); }
.list .tag { font-family: var(--font); font-size: .76rem; color: var(--dim); }
.list li.used .code, .list li.revoked .code { color: var(--dim); text-decoration: line-through; }

@media (max-width: 900px) {
  /* 右の枠は、幅が足りない画面では本文の下に回す */
  .shell { grid-template-columns: auto 1fr; }
  .rcol { grid-column: 2; position: static; max-height: none; width: auto; border-left: 0; border-top: 1px solid var(--line); padding: 12px; }
}

@media (max-width: 480px) {
  /* 狭い画面の入口の帯は2段: 上に 言語 と メニュー、下に 検索欄 */
  .top { padding: 10px 8px; gap: 8px 6px; }
  .front { grid-template-columns: auto 1fr; grid-template-areas: "lang me" "search search"; }
  .front #lang { grid-area: lang; }
  .front .me { grid-area: me; }
  .front .search { grid-area: search; max-width: none; }
  #me-btn { max-width: 78px; overflow: hidden; text-overflow: ellipsis; }
  .top button { padding: 6px 9px; font-size: .84rem; }
  .me { gap: 5px; }
  .brand { font-size: 1.1rem; letter-spacing: .06em; }
  .card { padding: 22px 16px 18px; }
  /* 狭い画面でも左の欄は左に置く。いつも狭い形（絵の下に小さい名前）で、切り替えのボタンは出さない */
  .lnav, .lnav.narrow { top: 113px; height: calc(100vh - 113px); width: 66px; padding: 8px 4px; }
  .lnav-toggle { display: none; }
  .lnav h4 { margin: 12px 0 4px; text-align: center; font-size: .66rem; }
  .lnav-item { flex-direction: column; gap: 3px; padding: 9px 2px; font-size: .64rem; text-align: center; }
  .lnav-item span { max-width: 100%; }
  .hero { padding: 10vh 12px; }
  .tool { padding: 10px 8px 30px; }
  .tg-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
}
@media (max-width: 760px) {
  /* 一件の画面は、幅が足りなければ 絵の下にタグ */
  .tg-view { grid-template-columns: minmax(0, 1fr); }
  .tg-stage, .tg-big { max-height: 60vh; }
}

/* 問い合わせの窓の欄 */
textarea, select { font: inherit; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; }
textarea { resize: vertical; }
textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--acc) 45%, transparent); border-color: var(--acc); }

/* パスワードの欄の「見せる／隠す」 */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 84px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--dim); font-size: .82rem; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.pw-eye:hover { color: var(--acc); background: var(--soft); }

/* チェックポイントと LoRA の棚・上げる所 */
.sh-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.sh-bar input { flex: 1 1 200px; min-width: 160px; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sh-card { text-align: left; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; background: var(--bg); }
.sh-card:hover { border-color: var(--acc); }
.sh-card.dim { opacity: .7; }
.sh-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sh-badge { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; font-size: .75rem; color: var(--dim); }
.sh-badge.acc { color: var(--acc); border-color: var(--acc); }
.sh-badge.ng { color: var(--ng); border-color: var(--ng); }
.sh-name { font-weight: 700; overflow-wrap: anywhere; }
.sh-sub { color: var(--dim); font-size: .85rem; margin: 0; overflow-wrap: anywhere; }
.sh-by { color: var(--dim); font-size: .82rem; }
.sh-fav { font-size: .82rem; color: var(--dim); }
.sh-fav.on { color: var(--acc); }
.sh-price { margin-left: auto; font-size: .82rem; color: var(--dim); }
.sh-detail { border: 1px solid var(--acc); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; display: grid; gap: 8px; }
.sh-detail h2 { margin: 4px 0 0; overflow-wrap: anywhere; }
.sh-detail .sh-x { margin-left: auto; padding: 4px 12px; font-size: .82rem; }
.sh-note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.up-form { display: grid; gap: 12px; max-width: 560px; margin-top: 10px; }
.up-form label { display: grid; gap: 4px; }
.up-form label.check { display: flex; gap: 8px; align-items: center; }
.up-form label > span { color: var(--dim); font-size: .88rem; }
.up-bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; border: 1px solid var(--line); }
.up-fill { height: 100%; width: 0; background: var(--acc); }
.up-mine { margin-top: 26px; max-width: 760px; display: grid; gap: 8px; }
.up-mine h3 { margin: 0 0 4px; font-size: 1rem; }
.up-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.up-row .pick, .up-row button { padding: 4px 12px; font-size: .82rem; }
.up-form label.check input { width: auto; flex: 0 0 auto; }
.up-form label.check > span { color: var(--ink); font-size: 1rem; }

/* タグ検索: 語の属性を直す入口（一番下・直せる人にだけ出る）と、属性の札の並び */
.tg-editline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tg-edithint { color: var(--dim); font-size: .86rem; }
.tg-attrs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }

/* 上げる画面: ① プロジェクト → ② 版とファイル */
.up-form h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.up-form h4 { margin: 14px 0 6px; font-size: .92rem; color: var(--dim); font-weight: 600; }
.up-box { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.up-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.up-two label { margin: 0; }
.sh-bar select { max-width: 190px; }
.sh-vers { flex-wrap: wrap; margin: 6px 0 10px; }
@media (max-width: 640px) { .up-two { grid-template-columns: 1fr; } }

/* モデルのページ: 表紙・見本の絵・そのモデルで作った投稿・コメント */
.sh-cover { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--line); display: grid; place-items: center; color: var(--dim); font-size: .9rem; }
.sh-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-shows { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.sh-show { position: relative; width: 150px; height: 150px; border-radius: 10px; overflow: hidden; background: var(--line); }
.sh-show img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.sh-show.big { width: 100%; height: auto; }
.sh-show.big img { height: auto; object-fit: contain; cursor: zoom-out; }
.sh-show-x { position: absolute; top: 4px; right: 4px; padding: 0 8px; background: var(--bg); }
.sh-detail h3 { margin: 22px 0 8px; font-size: 1.02rem; }
.sh-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sh-post { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 4px; }
.sh-cform { display: grid; gap: 8px; justify-items: start; }
.sh-cform textarea { width: 100%; }
.sh-comments { display: grid; gap: 10px; margin-top: 10px; }
.sh-comment { border-top: 1px solid var(--line); padding-top: 8px; }
.sh-comment .sh-row { gap: 8px; align-items: center; flex-wrap: wrap; }
.sh-post { cursor: pointer; }
.sh-post.open { grid-column: 1 / -1; cursor: default; }
.sh-post.open img { max-width: 100%; border-radius: 10px; }
.up-warn { border: 1px solid var(--acc); border-radius: 10px; padding: 8px 10px; color: var(--ink); }

/* モデルのページ（tensor.art のモデルのページの並びを写した） */
#tool-shelf.one .sh-bar, #tool-shelf.one #sh-grid, #tool-shelf.one #sh-msg { display: none; }
#tool-shelf.one .sh-detail { border: 0; padding: 0; margin: 0; }
.md-back { margin-bottom: 10px; }
.md-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.md-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.md-title h1 { margin: 0; font-size: 2rem; line-height: 1.2; }
.md-kind { background: color-mix(in srgb, var(--acc) 14%, transparent); color: var(--acc); font-weight: 700; font-size: .8rem; padding: 3px 10px; border-radius: 6px; letter-spacing: .04em; }
.md-fav { border-radius: 12px; padding: 10px 16px; font-weight: 600; }
.md-fav.on { border-color: var(--acc); color: var(--acc); }
.md-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--dim); margin: 8px 0 10px; }
.md-origin { color: var(--ok); font-weight: 600; }
.md-origin.re { color: var(--ng); }
.md-by { color: var(--ink); font-weight: 600; }
.md-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.md-chip { background: var(--soft); border-radius: 6px; padding: 3px 12px; font-size: .9rem; }
.md-chip.hot { background: var(--acc); color: var(--acc-ink); font-weight: 600; }
.md-vers { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.md-vers button { border-radius: 8px; border: 0; background: var(--soft); white-space: nowrap; font-weight: 600; padding: 8px 14px; }
.md-vers button.on { background: var(--ink); color: var(--bg); }
.md-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.md-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.md-gal.none { min-height: 220px; border-radius: 14px; background: var(--soft); place-items: center; color: var(--dim); grid-template-columns: 1fr; }
.md-pic { position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--soft); }
.md-pic img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.md-gal.zoom .md-pic.big { grid-column: 1 / -1; aspect-ratio: auto; }
.md-gal.zoom .md-pic.big img { height: auto; object-fit: contain; cursor: zoom-out; }
.md-add { margin-top: 10px; }
.md-note { white-space: pre-wrap; margin: 14px 0 0; }
.md-act { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.md-run, .md-dl { border-radius: 12px; padding: 14px 10px; font-weight: 700; font-size: 1.02rem; }
.md-dl:disabled { color: var(--dim); cursor: not-allowed; }
.md-box { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 12px; }
.md-box h3 { margin: 0 0 10px; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.md-kv { display: grid; grid-template-columns: 9em 1fr; gap: 8px; margin: 6px 0; }
.md-kv span { color: var(--dim); }
.md-kv b { font-weight: 500; word-break: break-word; }
.md-warn { background: color-mix(in srgb, var(--ng) 12%, transparent); color: var(--ng); font-size: .8rem; padding: 2px 10px; border-radius: 999px; }
.md-src { margin: 0 0 8px; font-size: .9rem; word-break: break-all; }
.md-perm { display: flex; gap: 8px; margin: 5px 0; color: var(--dim); }
.md-perm i { font-style: normal; color: var(--dim); }
.md-perm.ok { color: var(--ink); }
.md-perm.ok i { color: var(--ok); }
.md-own { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.md-h { margin: 26px 0 10px; font-size: 1.1rem; }
@media (max-width: 900px) { .md-body { grid-template-columns: 1fr; } .md-title h1 { font-size: 1.5rem; } }
.md-back { justify-self: start; width: auto; }
.sh-detail > .md-back { display: inline-block; }
#tool-shelf.one .sh-detail { display: block; }

/* 棚のカード（見本: tensorhub.art の一覧のカード。縦長の絵いっぱい・左上に札・下に名前と作者と数） */
.sh-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.sh-card.tc { padding: 0; border: 0; border-radius: 14px; overflow: hidden; display: block; background: var(--soft); }
.tc-pic { position: relative; aspect-ratio: 264 / 342; background: linear-gradient(160deg, #3a3a4c, #1d1d28); }
.tc-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-top { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.tc-b { background: rgba(20, 20, 30, .62); color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .02em; }
.tc-b.re { background: rgba(212, 61, 81, .85); }
.tc-b.ng { background: rgba(120, 120, 140, .85); }
.tc-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 10px 10px; color: #fff; text-align: left;
  background: linear-gradient(to top, rgba(10, 10, 18, .88), rgba(10, 10, 18, 0)); }
.tc-name { font-weight: 700; font-size: .98rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tc-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: .82rem; opacity: .92; }
.tc-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-n.on { color: #ffd166; }
.sh-card.tc:hover { outline: 2px solid var(--acc); }
/* モデルのページ: 見本の絵は横1列 */
.md-galbox { position: relative; }
.md-gal { display: flex; grid-template-columns: none; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.md-gal::-webkit-scrollbar { display: none; }
.md-gal .md-pic { flex: 0 0 calc((100% - 36px) / 4); min-width: 170px; scroll-snap-align: start; }
.md-gal.zoom { flex-wrap: wrap; }
.md-gal.zoom .md-pic.big { flex-basis: 100%; }
.md-gal.none { display: grid; }
.md-ar { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1;
  background: var(--bg); box-shadow: 0 4px 14px rgba(20, 20, 40, .25); }
.md-ar.l { left: -10px; } .md-ar.r { right: -10px; }
.md-desc.cut { max-height: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.md-ex { margin-top: 6px; }
.md-ph { margin: 12px 0 4px; font-size: .88rem; color: var(--dim); font-weight: 600; }
.md-who { display: flex; align-items: center; gap: 12px; }
.md-who div { display: grid; }
.md-ava { width: 44px; height: 44px; border-radius: 50%; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.md-box .sh-posts { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
@media (max-width: 900px) { .md-gal .md-pic { flex-basis: 46%; } }
#sh-channel { display: none; }
.sh-chs { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0 4px; padding-bottom: 4px; }
.sh-chs button { border: 0; background: var(--soft); border-radius: 8px; padding: 6px 14px; white-space: nowrap; font-weight: 600; }
.sh-chs button.on { background: var(--ink); color: var(--bg); }
#tool-shelf.one .sh-chs { display: none; }

/* 上げる画面: 見本と同じ「並んだ札から1つ」・落とし込みの枠 */
.up-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.up-radios button { border-radius: 8px; padding: 7px 16px; background: var(--bg); }
.up-radios button.on { border-color: var(--acc); color: var(--acc); font-weight: 700; background: color-mix(in srgb, var(--acc) 8%, transparent); }
.up-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 22px 16px; text-align: center; cursor: pointer; }
.up-drop.over { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 6%, transparent); }
.up-moreb { justify-self: start; }
.up-more { display: grid; gap: 12px; }
.up-form h3 { font-size: 1.3rem; margin-top: 28px; }
.up-form h4 { color: var(--ink); font-size: 1.02rem; border-left: 4px solid var(--acc); padding-left: 10px; margin-top: 20px; }
.md-go { display: inline-block; border-radius: 12px; padding: 10px 16px; font-weight: 700; background: var(--ink); color: var(--bg); white-space: nowrap; margin-left: auto; }
.md-go:hover { background: var(--acc); color: var(--acc-ink); }
.md-box .md-go { display: block; text-align: center; margin: 0 0 10px; }
.up-srcbox { display: grid; gap: 10px; }

/* 絵を押した時の見せ方（画面いっぱいの暗い幕。ページの並びは動かさない） */
body.vw-open { overflow: hidden; }
.vw { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 10, 14, .94); display: flex; align-items: center; justify-content: center; }
.vw img { max-width: calc(100vw - 160px); max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px; display: block; }
.vw-x { position: absolute; top: 16px; left: 16px; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.2rem; }
.vw-ar { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 1.8rem; line-height: 1; }
.vw-ar.l { left: 20px; } .vw-ar.r { right: 20px; }
.vw-ar:hover, .vw-x:hover { background: rgba(255, 255, 255, .3); }
.vw-dots { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; }
.vw-dots span { width: 22px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.vw-dots span.on { background: #fff; }
.md-pic img { cursor: zoom-in; }
@media (max-width: 700px) { .vw img { max-width: 100vw; max-height: calc(100vh - 120px); } .vw-ar { top: auto; bottom: 40px; transform: none; } }

/* 見本の絵（小さい時）: 見本＝Civitai のモデルのページ。2枚を大きく、絵ごとの縦横の形のまま、切らずに、上下の真ん中で揃える */
.md-gal { align-items: center; }
.md-gal .md-pic { flex: 0 0 calc((100% - 12px) / 2); min-width: 0; aspect-ratio: auto; background: transparent; }
.md-gal .md-pic img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: 14px; }
@media (max-width: 900px) { .md-gal .md-pic { flex-basis: 86%; } }

/* 動く絵の見本 */
.tc-pic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.md-gal .md-pic video { width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: 14px; display: block; cursor: zoom-in; }
.vw-slot { display: flex; align-items: center; justify-content: center; }
.vw-slot img, .vw-slot video { max-width: calc(100vw - 160px); max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px; display: block; }
@media (max-width: 700px) { .vw-slot img, .vw-slot video { max-width: 100vw; max-height: calc(100vh - 120px); } }
