/* NOTE MARK - 基本レイアウト */

:root {
  --bg: #f5f7fb;
  --accent: #2563eb;
  --accent-soft: #e0edff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --danger: #ef4444;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */

.nm-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
}

.nm-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nm-logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 18px;
}

.nm-logo span {
  color: var(--accent);
}

.nm-nav ul {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: var(--text-sub);
}

.nm-nav a {
  color: inherit;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 999px;
}

.nm-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* メイン */

.nm-main {
  flex: 1;
}

.nm-hero {
  max-width: 1080px;
  margin: 24px auto 8px;
  padding: 0 16px 8px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #ecfdf5;
  color: #166534;
  margin-bottom: 12px;
}

.hero-tag b {
  font-weight: 600;
}

.hero-title {
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-lead {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 20px;
}

/* キャプチャ / アップロード */

.capture-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.capture-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.field-group {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-sub);
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label .req {
  color: var(--danger);
  margin-left: 4px;
}

.field-group input[type="file"] {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #f9fafb;
}

.field-help {
  font-size: 10px;
  color: var(--text-sub);
}

.capture-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn-main {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.28);
}

.btn-main .icon {
  font-size: 15px;
}

.btn-main:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.btn-main:not(:disabled):hover {
  filter: brightness(1.03);
  transform: translateY(-0.5px);
}

.btn-sub {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
}

.btn-sub:hover {
  background: #f8fafc;
}

.note {
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* ワークスペース */

.workspace-wrap {
  max-width: 1080px;
  margin: 12px auto 32px;
  padding: 0 16px 24px;
}

.workspace-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr);
  gap: 16px;
  min-height: 380px;
}

@media (max-width: 800px) {
  .workspace-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

.preview-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-sub);
}

.preview-hint {
  font-size: 11px;
  color: var(--text-sub);
}

.preview-frame {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  overflow: hidden;
  position: relative;
  min-height: 260px;
}

.preview-inner {
  position: relative;
  background: #f9fafb;
  min-height: 260px;
  cursor: crosshair;
}

/* 画像 / PDF 表示：白背景＋コンテンツのみ */

.preview-inner .uploaded-media {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  margin: 0 auto;
}

/* PDF の場合は iframe / embed をフル表示 */

.preview-inner .uploaded-pdf {
  width: 100%;
  height: 70vh;
  border: none;
}

/* 初期状態 */

.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  text-align: center;
  color: var(--text-sub);
}

.preview-empty strong {
  font-size: 13px;
}

.preview-empty span {
  font-size: 11px;
}

/* ピン */

.pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f97316;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.pin:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

/* サムネイル */

.thumb-strip {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  padding: 6px;
  background: #f9fafb;
  min-height: 40px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.thumb-empty {
  font-size: 11px;
  color: var(--text-sub);
}

.thumb-item {
  position: relative;
  width: 72px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
  flex: 0 0 auto;
  cursor: pointer;
}

.thumb-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.thumb-item img,
.thumb-item .thumb-pdf {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-label {
  position: absolute;
  left: 4px;
  bottom: 3px;
  right: 20px;
  font-size: 9px;
  color: #ffffff;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.thumb-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #f9fafb;
  font-size: 11px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* サイドバー */

.sidebar {
  border-left: 1px solid var(--border);
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-title {
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar small {
  font-size: 11px;
  color: var(--text-sub);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  max-height: 260px;
  overflow: auto;
}

.comment-item {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: #f9fafb;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
}

.comment-index {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #f97316;
  color: #111827;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.comment-body {
  font-size: 12px;
}

.comment-meta {
  grid-column: 2 / -1;
  font-size: 10px;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
}

.comment-delete {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
}

.comment-delete:hover {
  background: #fee2e2;
}

.comment-empty {
  font-size: 12px;
  color: var(--text-sub);
  padding: 10px 0;
}

/* 共有リンク */

.share-row {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--text-sub);
}

.share-row-inner {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.share-input {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: #f9fafb;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  font-size: 11px;
  background: #e0f2fe;
  color: #0369a1;
  cursor: pointer;
}

.share-btn:hover {
  background: #bae6fd;
}

.share-note {
  font-size: 10px;
  color: var(--text-sub);
}

/* トースト */

.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  background: #111827;
  color: #e5e7eb;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.4);
  z-index: 50;
}

.toast.show {
  display: inline-flex;
  animation: fadeToast 2.2s ease-out forwards;
}

@keyframes fadeToast {
  0% { opacity: 0; transform: translate(-50%, -6px); }
  10% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}

/* モーダル */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 16px 12px;
  max-width: 360px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.modal h3 {
  font-size: 14px;
  margin: 0;
}

.modal small {
  font-size: 11px;
  color: var(--text-sub);
}

.modal textarea {
  margin-top: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 70px;
}

.modal textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-ghost {
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
}

.btn-ghost:hover {
  background: #f1f5f9;
}

.btn-primary {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

/* フッター */

.nm-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px 16px;
  font-size: 11px;
  color: var(--text-sub);
  text-align: center;
}


/* アフィリエイト広告（共通） */
.affiliate-area {
  max-width: 1080px;   /* ここで幅を統一 */
  width: 100%;
  margin: 24px auto 32px;
  padding: 0 16px;
}

.affiliate-inner {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px 16px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.affiliate-label {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.affiliate-slot {
  min-height: 90px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
}

.affiliate-slot span {
  font-size: 12px;
  color: var(--text-sub);
}

@media (max-width: 600px) {
  .affiliate-area {
    margin: 16px auto 24px;
  }
  .affiliate-slot {
    min-height: 70px;
  }
}


/* affiliate area */
.affiliate-area{
  background:#fff;
  border-bottom:1px solid #e2e8f0;
  padding:12px 16px;
}

.affiliate-inner{
  max-width:1080px;   /* サイトの基準幅に合わせる（必要なら調整） */
  margin:0 auto;
}

.affiliate-slot{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  overflow:hidden;
}

/* PC/SPで広告を切り替え */
.ad-desktop{ display:block; }
.ad-mobile{ display:none; }

@media (max-width: 760px){
  .ad-desktop{ display:none; }
  .ad-mobile{ display:block; }
}
