/* ===== 利用者向けページ（納品・再納品）専用スタイル =====
   白＋墨＋ヘアライン。装飾は最小限、入力欄は大きく、スマホ優先。管理画面の styles.css とは独立。 */
:root {
  --ink: #16161a;
  --muted: #6a6a72;
  --line: #dcdce1;
  --paper: #f7f7f8;
  --card: #ffffff;
  --accent: #0076d2; /* ラシクラボのコーポレートカラー（公開サイトと同じ青） */
  --accent-deep: #d9a30a;
  --red: #b3261e;
  --red-bg: #fdecea;
  --green: #1f8a4c;
  font-family: "Zen Kaku Gothic New", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }

/* ---- ヘッダー ---- */
header { padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand h1 { font-size: 18px; margin: 0; font-weight: 900; letter-spacing: .02em; }
.brand-sub { margin: 0; font-size: 12px; color: var(--muted); }

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---- テーマ見出し ---- */
.theme { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
.theme-kicker { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.theme-title { margin: 4px 0 6px; font-size: 28px; font-weight: 900; line-height: 1.3; }
.theme-deadline { margin: 0; font-size: 15px; }
.theme-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ---- お知らせ ---- */
.alert { border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; font-size: 14px; line-height: 1.6; }
.alert strong { display: block; font-size: 15px; margin-bottom: 2px; }
.alert-error { background: var(--red-bg); color: #7a1f16; border: 1px solid #f0c2bc; }
.alert-info { background: var(--card); border: 1px solid var(--line); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert p { margin: 6px 0 0; }
#load-error .btn-secondary { width: auto; margin-top: 12px; font-size: 15px; padding: 10px 18px; }

/* ---- フォーム本体（番号付きステップ） ---- */
.form { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 22px 22px; }
.step { padding: 22px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; padding-bottom: 4px; }
.step-title { margin: 0 0 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.field { display: block; margin: 0 0 16px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.req, .opt { font-size: 11px; font-style: normal; font-weight: 700; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.req { color: var(--red); background: var(--red-bg); border: 1px solid #f0c2bc; }
.opt { color: var(--muted); background: var(--paper); border: 1px solid var(--line); }
.counter { float: right; font-size: 12px; font-weight: 400; color: var(--muted); }

input[type="text"], select, textarea {
  width: 100%; font: inherit; font-size: 16px; line-height: 1.5;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink);
}
select { appearance: auto; }
textarea { resize: vertical; min-height: 96px; }
input[type="text"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(246, 195, 67, .45);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field-hint { display: block; font-size: 13px; color: var(--muted); margin-top: 5px; }
.field-error { display: block; font-size: 13px; color: var(--red); font-weight: 700; margin-top: 6px; }

/* ---- 画像選択 ---- */
.dropzone {
  display: block; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 10px; padding: 22px 16px; background: var(--paper);
}
.dropzone:hover, .dropzone:focus-within, .dropzone.is-over { border-color: var(--ink); background: #fbfaf6; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone-main { display: block; font-size: 16px; font-weight: 800; }
.dropzone-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.preview { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; }
.preview img { max-width: 140px; max-height: 300px; border: 1px solid var(--line); border-radius: 8px; background: #fff; flex: none; }
.preview-info { font-size: 14px; min-width: 0; }
.preview-name { word-break: break-all; color: var(--muted); }
.preview-dim { font-weight: 700; margin-top: 2px; }
.preview-ok { color: var(--green); }
.preview-warn { color: var(--red); margin: 6px 0 0; font-size: 13px; }
.btn-link { font: inherit; font-size: 14px; color: var(--ink); background: none; border: none; padding: 0; margin-top: 8px; text-decoration: underline; cursor: pointer; }

/* ---- 同意 ---- */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0 10px; cursor: pointer; font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }

/* ---- ボタン ---- */
.btn-primary, .btn-secondary {
  display: block; width: 100%; font: inherit; font-size: 17px; font-weight: 800;
  padding: 15px; border-radius: 10px; cursor: pointer; margin-top: 10px;
}
.btn-primary { background: var(--accent); border: 1px solid var(--accent-deep); color: var(--ink); }
.btn-primary:hover { background: #f0b52a; }
.btn-secondary { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-primary[disabled], .btn-secondary[disabled] { opacity: .55; cursor: default; }
.note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* ---- 読み込み・完了 ---- */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 60px 0; font-size: 15px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(28,26,20,.15); border-top-color: var(--ink); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 36px 20px 28px; }
.done-kicker { margin: 0 0 14px; font-size: 24px; font-weight: 900; }
.done-label { margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.receipt { margin: 2px 0 10px; font-size: 36px; font-weight: 900; letter-spacing: .05em; }
.done-msg { margin: 0 0 18px; font-size: 15px; }

/* ---- トースト ---- */
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(92vw, 380px); }
.toast { background: var(--ink); color: #fff; border-radius: 10px; padding: 13px 16px; font-size: 14px; line-height: 1.55; display: flex; gap: 10px; box-shadow: 0 10px 28px -10px rgba(0,0,0,.5); animation: toast-in .25s ease; }
.toast.out { animation: toast-out .25s ease forwards; }
.toast::before { content: ""; width: 4px; align-self: stretch; border-radius: 4px; background: var(--accent); flex: none; }
.toast.success::before { background: #4ade80; }
.toast.error::before { background: #f87171; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

@media (max-width: 480px) {
  main { padding: 14px 10px 60px; }
  .theme, .form { padding-left: 16px; padding-right: 16px; }
  .theme-title { font-size: 24px; }
  .preview img { max-width: 110px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; } }

/* ---- ヘッダーのナビ ---- */
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav a { font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; }
.nav a:hover { border-color: var(--ink); }

/* ---- 出どころの選択・ネタ本文の引用 ---- */
/* 種類の選択。ラベルの長さがバラバラで折り返しが不揃いになるため、
   1つずつ枠のあるカードにして、説明は小さい字で2行目に置く */
.choice-label { margin: 0 0 8px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.choice .check {
  padding: 12px 14px; margin: 0; align-items: flex-start; gap: 10px;
  border: 2px solid var(--line); border-radius: 10px; background: var(--card);
}
.choice .check:hover { border-color: var(--muted); }
.choice .check:has(input:checked) { border-color: var(--ink); background: #fbfaf6; }
.choice input[type="radio"] { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.choice-text { display: block; min-width: 0; }
.choice-text b { display: block; font-size: 15px; font-weight: 800; line-height: 1.4; }
.choice-text small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* 短い入力欄は横に2つ並べる（画面が狭ければ1列に戻す） */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-2 .field:last-child { margin-bottom: 16px; }

/* 作品カードは「画像 | 入力欄」の2列。画像を大きく見せつつ縦を短くする */
.card-body { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 18px; align-items: start; }
.card-media, .card-fields { min-width: 0; }
/* 画像の枠は大きめに。左の列がスカスカに見えず、ドラッグの的も広くなる */
.card-media .dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 190px; }
/* 画像を選んだ後は選択枠を細くして、選んだ画像を主役にする
   （枠は残す＝別の画像をドラッグして置き換えられる） */
.card-media:has([data-preview]:not([hidden])) .dropzone { min-height: 0; padding: 10px 12px; }
.card-media:has([data-preview]:not([hidden])) .dropzone-main { font-size: 14px; }
.card-media:has([data-preview]:not([hidden])) .dropzone-sub { display: none; }
.card-media .preview { flex-direction: column; gap: 10px; }
.card-media .preview img { max-width: 100%; max-height: 220px; }

@media (max-width: 640px) {
  .choice { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .card-body { grid-template-columns: 1fr; gap: 0; }
  .card-media { margin-bottom: 16px; }
  .card-media .dropzone { min-height: 130px; }
  .card-media .preview { flex-direction: row; }
  .card-media .preview img { max-width: 120px; }
}
.idea-quote { margin: 4px 0 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--paper); border-radius: 0 8px 8px 0; font-size: 15px; white-space: pre-wrap; }

/* ---- ネタ庫一覧 ---- */
.section-title { font-size: 18px; font-weight: 900; margin: 28px 0 10px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 12px; font-size: 14px; }
.filters select { width: auto; padding: 8px 10px; font-size: 14px; }
.filters .check { padding: 0; font-size: 14px; }
.filters .check input { width: 18px; height: 18px; }
.idea-list { display: flex; flex-direction: column; gap: 10px; }
.idea-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.idea-card.is-used, .idea-card.is-done { background: #fbfaf7; }
.idea-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.idea-num { font-weight: 900; font-size: 15px; }
.tag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--line); }
.tag-open { background: #e8f5ec; color: var(--green); border-color: #bfe3cb; }
.tag-used { background: #eeeef1; color: var(--muted); }
.tag-done { background: #ebf6fe; color: #0076d2; border-color: #b9dcfb; }
.idea-office { font-size: 12px; color: var(--muted); margin-left: auto; }
.idea-text { margin: 0; font-size: 15px; white-space: pre-wrap; }
.is-used .idea-text, .is-done .idea-text { color: var(--muted); }
.idea-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.idea-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 10px; }
.btn-small { font: inherit; font-size: 14px; font-weight: 800; padding: 9px 14px; border-radius: 8px; cursor: pointer; background: var(--accent); border: 1px solid var(--accent-deep); color: var(--ink); }
.btn-small:hover { background: #f0b52a; }
.btn-small[disabled] { opacity: .55; cursor: default; }
.claim-form { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.claim-form .field { margin-bottom: 12px; }
.claim-form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.claim-form .row .btn-small { flex: 1; }
.claim-form .row .btn-secondary { margin-top: 0; width: auto; flex: 1; font-size: 14px; padding: 9px 14px; }
.claim-done { margin-top: 10px; padding: 12px 14px; background: #e8f5ec; border: 1px solid #bfe3cb; border-radius: 10px; font-size: 14px; }
.claim-done a { color: var(--ink); font-weight: 800; }

/* ---- トップ（入口）の二択 ---- */
.brand h1 a { color: inherit; text-decoration: none; }
.entry-lead { margin: 8px 0 12px; font-size: 16px; font-weight: 800; }
.entry { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entry-card {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 22px 20px 18px; min-height: 180px;
}
.entry-card:hover, .entry-card:focus-visible { border-color: var(--ink); outline: none; }
.entry-title { font-size: 22px; font-weight: 900; line-height: 1.3; }
.entry-desc { font-size: 14px; color: var(--muted); flex: 1; }
.entry-go { font-size: 15px; font-weight: 800; background: var(--accent); border: 1px solid var(--accent-deep); border-radius: 8px; padding: 10px 14px; text-align: center; }
.entry-note { margin-top: 16px; }
@media (max-width: 560px) { .entry { grid-template-columns: 1fr; } .entry-card { min-height: 0; } }

/* ---- 再納品ページ: スタッフからの差し戻し理由 ---- */
.revise-comment { margin: 8px 0 0; font-size: 15px; white-space: pre-wrap; color: var(--ink); }

/* ---- 作品カード ---- */
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 14px; background: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-title { font-size: 15px; font-weight: 800; margin: 0; }
.card-remove { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.card-remove:hover { color: var(--red); border-color: var(--red); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--accent-deep); width: 0; transition: width .2s ease; }
.tag-box { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 46px; }
.tag-box input { flex: 1; min-width: 120px; border: none; padding: 6px 4px; font-size: 16px; }
.tag-box input:focus { outline: none; box-shadow: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 14px; }
.tag button { border: none; background: none; font: inherit; cursor: pointer; color: var(--muted); padding: 0; line-height: 1; }
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px -12px rgba(0,0,0,.3); margin: 4px 0 0; padding: 4px 0; list-style: none; max-height: 200px; overflow: auto; }
.suggest-list li { padding: 8px 12px; cursor: pointer; font-size: 15px; }
.suggest-list li:hover, .suggest-list li.is-active { background: var(--paper); }
.vector-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.vector-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.vector-error { color: var(--red); font-weight: 700; text-align: right; }
.add-card { display: block; width: 100%; font: inherit; font-size: 16px; font-weight: 800; padding: 14px; border: 2px dashed var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.add-card:hover { border-color: var(--ink); }

/* 3Dの仕様欄。チェックは横並び、数値入力は2列 */
.spec-checks { display: flex; flex-wrap: wrap; gap: 0 18px; margin-bottom: 6px; }
.spec-checks .check { padding: 2px 0; font-size: 14px; }
.spec-checks .check input { width: 18px; height: 18px; }
.spec-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .spec-inputs { grid-template-columns: 1fr; } }

/* 確認して納品: チェックは1つ、内容は箇条書きで示す */
.consent-lead { margin: 0 0 6px; font-size: 15px; }
.consent-list { margin: 0 0 10px; padding-left: 1.2em; font-size: 14px; line-height: 1.9; color: var(--muted); }

/* 種類別の入口。固定した種類だけ残し、ほかは隠す */
.choice.is-fixed label.check { cursor: default; }
.kind-fixed-note { margin: 6px 0 14px; }
.kind-fixed-note a { color: var(--accent); }
