@charset "UTF-8";
/* CAMPFIRE伴走管理システム / デザインシステム
 *
 * STORY LP と同じブランドに見えることを目標にする。
 *
 *   ・背景と面がほぼ同じ色。白いカードを並べない
 *   ・光は左上から。カードは「浮く」、入力と公開前チェックは「凹む」
 *   ・影は繊細に。立体的な箱ではなく、光の加減で少し浮いて見える程度
 *   ・角丸は控えめ（大18 / 中14 / 入力11 / タグは999）
 *   ・オレンジは全体の5〜10%程度。CTA・アクティブ・重要な数字だけ
 */

:root {
	--bg:          #F1F2F4;   /* ページ背景 */
	--surface:     #F1F2F4;   /* 面（背景と同色。影だけで浮かせる） */
	--sunken:      #EDEEF0;   /* 凹んだ面 */

	--text:        #252936;
	--muted:       #7F858E;
	--faint:       #A0A5AC;
	--hairline:    rgba(160,165,172,.22);

	--accent:      #D99A32;
	--accent-2:    #E0A03A;
	--accent-deep: #B87E22;
	--accent-tint: rgba(217,154,50,.12);

	--ok:      #4E8A6B;
	--warn:    #B98428;
	--danger:  #B4534A;
	--info:    #5A7BA6;

	/* ニューモフィズムの2色。光は左上、影は右下 */
	--sh-light: rgba(255,255,255,.85);
	--sh-dark:  rgba(180,185,195,.28);

	/* 浮く（繊細に） */
	--lift:    6px 6px 14px var(--sh-dark), -6px -6px 14px var(--sh-light);
	--lift-lg: 8px 8px 20px var(--sh-dark), -8px -8px 20px var(--sh-light);
	--lift-sm: 3px 3px 7px var(--sh-dark), -3px -3px 7px var(--sh-light);
	/* 凹む */
	--sink:    inset 5px 5px 10px rgba(180,185,195,.25), inset -5px -5px 10px rgba(255,255,255,.8);
	--sink-sm: inset 3px 3px 6px rgba(180,185,195,.22), inset -3px -3px 6px rgba(255,255,255,.75);

	--r-lg: 18px;
	--r-md: 14px;
	--r-sm: 11px;

	--sidebar-w: 236px;
	--header-h:  58px;

	--font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
	--font-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
	--font-num: "Figtree", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 14px;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--accent-tint); }

/* ============================================================
   レイアウト
   ============================================================ */

.layout { display: flex; min-height: 100vh; }

.sidebar {
	width: var(--sidebar-w);
	flex: 0 0 var(--sidebar-w);
	background: var(--bg);
	padding: 22px 16px 40px;
	position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 26px; }
.brand-mark {
	width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto;
	background: var(--surface); box-shadow: var(--lift-sm);
	display: grid; place-items: center;
	color: var(--accent); font-weight: 800; font-size: 15px; font-family: var(--font-num);
}
.brand-name { font-size: 13.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.4; }
.brand-name small { display: block; font-size: 9.5px; font-weight: 500; color: var(--faint); letter-spacing: .14em; }

.nav-group { margin-bottom: 24px; }
.nav-label { font-size: 9.5px; font-weight: 700; letter-spacing: .18em; color: var(--faint); padding: 0 10px 9px; }
.nav-item {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 12px; border-radius: var(--r-sm);
	font-size: 13px; color: var(--muted); margin-bottom: 4px;
	transition: color .15s ease, box-shadow .15s ease;
}
.nav-item:hover { color: var(--text); }
/* アクティブは「白背景＋強いオレンジ」ではなく、少し浮かせて文字をオレンジに */
.nav-item.is-active {
	background: var(--surface); box-shadow: var(--lift-sm);
	color: var(--accent-deep); font-weight: 700;
}
.nav-item .nav-icon { width: 15px; text-align: center; flex: 0 0 auto; opacity: .75; font-size: 12px; }
.nav-item.is-active .nav-icon { opacity: 1; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.header {
	height: var(--header-h);
	display: flex; align-items: center; gap: 16px; padding: 0 30px;
	position: sticky; top: 0; z-index: 30;
	background: rgba(241,242,244,.88);
	backdrop-filter: blur(10px);
}
.header-title {
	font-size: 13.5px; font-weight: 700; color: var(--muted);
	min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.header-user { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.avatar {
	width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
	background: var(--surface); box-shadow: var(--lift-sm);
	display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--accent-deep);
}
.bell { position: relative; font-size: 15px; color: var(--muted); line-height: 1; }
.bell-badge {
	position: absolute; top: -5px; right: -7px; min-width: 16px; height: 16px;
	border-radius: 999px; background: var(--accent); color: #fff;
	font-size: 10px; font-weight: 700; font-family: var(--font-num);
	display: grid; place-items: center; padding: 0 4px;
}

.content { padding: 10px 30px 70px; max-width: 1420px; width: 100%; }
.content.is-narrow { max-width: 880px; }

.page-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-family: var(--font-serif); font-size: 26px; font-weight: 600; line-height: 1.45; }
.page-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.eyebrow {
	font-family: var(--font-num);
	font-size: 10px; font-weight: 800; letter-spacing: .26em;
	color: var(--accent-deep); text-transform: uppercase; margin-bottom: 9px;
}
.eyebrow.is-muted { color: var(--faint); }

/* ============================================================
   面：浮く / 凹む
   ============================================================ */

.panel {
	background: var(--surface); border-radius: var(--r-lg);
	box-shadow: var(--lift); padding: 26px 28px; margin-bottom: 22px;
	/* サイドナビの #doc などで飛んだとき、見出しが上のヘッダーに隠れないようにする */
	scroll-margin-top: calc(var(--header-h) + 18px);
}
.panel-lg { box-shadow: var(--lift-lg); }
.panel-sm { border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--lift-sm); }
.panel.is-flush { padding: 0; overflow: hidden; }

/* 凹んだ面（入力エリア・公開前チェック・操作エリア） */
.well {
	background: var(--sunken); border-radius: var(--r-lg);
	box-shadow: var(--sink); padding: 24px 26px; margin-bottom: 22px;
	scroll-margin-top: calc(var(--header-h) + 18px);
}
.well-sm { border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--sink-sm); }

.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-title { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.panel-title small { font-weight: 400; color: var(--faint); font-size: 11.5px; margin-left: 9px; }
.panel-head .panel-action { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-work { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 22px; }

/* ============================================================
   ボタン
   ============================================================ */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	padding: 9px 17px; border: none; border-radius: var(--r-sm);
	background: var(--surface); color: var(--text); box-shadow: var(--lift-sm);
	font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
	transition: box-shadow .14s ease, color .14s ease, transform .08s ease;
}
.btn:hover { color: var(--accent-deep); }
.btn:active { box-shadow: var(--sink-sm); transform: translateY(1px); }
.btn-primary {
	color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent));
	box-shadow: 4px 4px 10px rgba(184,126,34,.24), -4px -4px 10px var(--sh-light);
}
.btn-primary:hover { color: #fff; box-shadow: 5px 5px 14px rgba(184,126,34,.3), -4px -4px 10px var(--sh-light); }
.btn-accent { color: var(--accent-deep); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 11.5px; border-radius: 9px; }
.btn-flat { box-shadow: none; background: transparent; color: var(--muted); }
.btn-flat:hover { box-shadow: var(--lift-sm); background: var(--surface); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* 外部リンク（CAMPFIREへ） */
.ext-link {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 18px; border-radius: var(--r-sm);
	background: var(--surface); box-shadow: var(--lift-sm);
	font-size: 12.5px; font-weight: 700; color: var(--text);
	transition: box-shadow .14s ease, color .14s ease;
}
.ext-link:hover { color: var(--accent-deep); box-shadow: var(--lift); }
.ext-link .arrow { font-family: var(--font-num); color: var(--accent); font-weight: 800; }
.ext-link.is-disabled { color: var(--faint); box-shadow: var(--sink-sm); background: var(--sunken); cursor: default; }
.ext-link.is-disabled .arrow { display: none; }

/* ============================================================
   バッジ・状態
   ============================================================ */

.tag {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 4px 12px; border-radius: 999px;
	font-size: 11px; font-weight: 700; line-height: 1.7; white-space: nowrap;
	background: var(--surface); color: var(--muted); box-shadow: var(--lift-sm);
}
.tag-accent { color: var(--accent-deep); }
.tag-ok     { color: var(--ok); }
.tag-warn   { color: var(--warn); }
.tag-danger { color: var(--danger); }
.tag-info   { color: var(--info); }
.tag-flat   { box-shadow: none; background: var(--sunken); }

/* ============================================================
   進捗
   ============================================================ */

.progress { display: flex; align-items: center; gap: 11px; }
.progress-track {
	flex: 1 1 auto; height: 8px; border-radius: 999px; min-width: 60px;
	background: var(--sunken); box-shadow: var(--sink-sm); overflow: hidden;
}
.progress-fill {
	height: 100%; border-radius: 999px;
	background: linear-gradient(90deg, var(--accent-2), var(--accent));
	transition: width .35s ease;
}
.progress-value { font-family: var(--font-num); font-weight: 800; font-size: 13px; min-width: 36px; text-align: right; }
.progress-edit { display: flex; align-items: center; gap: 3px; flex: none; }
.progress-edit-input {
	width: 3.6em; padding: 4px 6px; border-radius: 8px; border: none; text-align: right;
	font-family: var(--font-num); font-weight: 800; font-size: 13px; color: var(--text);
	background: var(--sunken); box-shadow: var(--sink-sm);
}
.progress-edit-input::placeholder { color: var(--faint); font-weight: 800; }
.progress-edit-unit { font-family: var(--font-num); font-weight: 800; font-size: 13px; color: var(--muted); }

.metric-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--faint); }
.metric-value { font-size: 17px; font-weight: 700; line-height: 1.5; margin-top: 3px; }
.metric-value.is-num { font-family: var(--font-num); font-size: 24px; font-weight: 800; }
.metric-note { font-size: 11.5px; color: var(--muted); line-height: 1.75; margin-top: 4px; }

/* ============================================================
   CAMPFIRE準備状況
   ============================================================ */

.ready-list { display: grid; gap: 2px; }
.ready-row {
	display: grid; grid-template-columns: 8.5em 1fr auto; align-items: center; gap: 14px; padding: 9px 0;
}
.ready-row + .ready-row { border-top: 1px solid var(--hairline); }
.ready-name { font-size: 12.5px; font-weight: 500; }
.ready-bar { height: 7px; border-radius: 999px; background: var(--sunken); box-shadow: var(--sink-sm); overflow: hidden; }
.ready-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .35s ease; }
.ready-row.is-todo  .ready-bar span { width: 4%; background: var(--faint); opacity: .5; }
.ready-row.is-doing .ready-bar span { width: 55%; }
.ready-row.is-done  .ready-bar span { width: 100%; }
.ready-value { font-size: 11.5px; color: var(--muted); white-space: nowrap; min-width: 6em; text-align: right; }
.ready-row.is-done .ready-value { color: var(--accent-deep); font-weight: 700; }

.ready-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ready-total b { font-family: var(--font-num); font-size: 30px; font-weight: 800; color: var(--accent-deep); }

/* ============================================================
   公開前チェック（ここだけ凹ませる・ガントチャート風）
   ============================================================ */

.gantt { display: grid; gap: 3px; }
.gantt-row {
	display: grid; grid-template-columns: 9.5em 1fr 26px; align-items: center; gap: 12px;
	padding: 7px 0; cursor: pointer; background: none; border: none; width: 100%; text-align: left;
}
.gantt-name { font-size: 12px; color: var(--muted); line-height: 1.5; }
.gantt-line { position: relative; height: 14px; display: flex; align-items: center; }
.gantt-line::before {
	content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
	background: repeating-linear-gradient(90deg, var(--faint) 0 4px, transparent 4px 8px); opacity: .45;
}
.gantt-line .bar {
	position: relative; height: 4px; border-radius: 999px; width: 0;
	background: linear-gradient(90deg, var(--accent-2), var(--accent));
	transition: width .35s ease;
}
.gantt-dot {
	width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
	background: var(--surface); box-shadow: var(--lift-sm);
	display: grid; place-items: center;
	font-size: 10px; color: transparent; font-weight: 800;
	transition: color .2s ease, box-shadow .2s ease;
}
.gantt-row.is-doing .bar { width: 55%; }
.gantt-row.is-done  .bar { width: 100%; }
.gantt-row.is-doing .gantt-name,
.gantt-row.is-done  .gantt-name { color: var(--text); }
.gantt-row.is-done  .gantt-dot { color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 2px 2px 6px rgba(184,126,34,.3); }
.gantt-row.is-doing .gantt-dot { box-shadow: 0 0 0 2px var(--accent-tint), var(--lift-sm); }
.gantt-row:hover .gantt-name { color: var(--text); }

/* ============================================================
   入力（凹ませる）
   ============================================================ */

.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; margin-bottom: 8px; color: var(--muted); }
.req { font-size: 9.5px; font-weight: 700; margin-left: 6px; padding: 2px 7px; border-radius: 5px; background: var(--accent); color: #fff; vertical-align: 1px; }
.opt { font-size: 10.5px; margin-left: 6px; color: var(--faint); vertical-align: 1px; }

.input, .select, .textarea {
	width: 100%; padding: 11px 14px; border: none; border-radius: var(--r-sm);
	background: var(--sunken); color: var(--text); line-height: 1.7;
	box-shadow: var(--sink-sm); transition: box-shadow .14s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: var(--sink-sm), 0 0 0 2px var(--accent-tint); }
.textarea { min-height: 96px; resize: vertical; }
.select {
	appearance: none; padding-right: 34px;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237F858E' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 13px center;
}
.input-lg { font-size: 17px; padding: 14px 16px; font-weight: 700; }
.hint { font-size: 11px; color: var(--faint); margin-top: 7px; line-height: 1.75; }

.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field-row-3 { grid-template-columns: repeat(3, 1fr); }

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-chip { position: relative; }
.radio-chip input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chip span {
	display: inline-block; padding: 8px 16px; border-radius: var(--r-sm);
	background: var(--surface); box-shadow: var(--lift-sm);
	font-size: 12.5px; cursor: pointer; color: var(--muted);
}
.radio-chip input:checked + span { color: var(--accent-deep); font-weight: 700; box-shadow: var(--sink-sm); background: var(--sunken); }

/* 保存の状態表示 */
.save-state { font-size: 11px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-state.is-saving { color: var(--muted); }
.save-state.is-saved  { color: var(--ok); }
.save-state.is-error  { color: var(--danger); font-weight: 700; }
.save-state .spinner {
	width: 11px; height: 11px; border-radius: 50%;
	border: 2px solid var(--hairline); border-top-color: var(--accent);
	animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   原稿エディター
   ============================================================ */

.doc-section { margin-bottom: 20px; }
.doc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-title-input {
	font-size: 13.5px; font-weight: 700; border: none; background: transparent;
	padding: 4px 8px; border-radius: 8px; min-width: 8em; flex: 1 1 16em;
}
.doc-title-input:focus { outline: none; background: var(--sunken); box-shadow: var(--sink-sm); }
.doc-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.toolbar {
	display: flex; flex-wrap: wrap; gap: 3px; align-items: center;
	padding: 7px 9px;
	background: var(--surface); border-radius: var(--r-md) var(--r-md) 0 0;
	box-shadow: var(--lift-sm); position: relative; z-index: 2;
}
.tb-btn {
	min-width: 30px; height: 30px; padding: 0 8px;
	display: inline-flex; align-items: center; justify-content: center;
	border: none; background: transparent; border-radius: 8px;
	font-size: 12px; color: var(--muted); cursor: pointer;
	transition: background .12s ease, color .12s ease;
}
.tb-btn:hover { background: var(--sunken); color: var(--text); }
.tb-btn.is-on { color: var(--accent-deep); background: var(--sunken); box-shadow: var(--sink-sm); }
.tb-sep { width: 1px; height: 18px; background: var(--hairline); margin: 0 5px; }
.tb-swatch { width: 19px; height: 19px; border-radius: 5px; border: 1px solid var(--hairline); cursor: pointer; padding: 0; }

.editor {
	min-height: 180px; padding: 20px 22px;
	background: var(--sunken); border-radius: 0 0 var(--r-md) var(--r-md);
	box-shadow: var(--sink);
	font-size: 14.5px; line-height: 2.05; outline: none;
}
.editor:focus { box-shadow: var(--sink), 0 0 0 2px var(--accent-tint); }
.editor:empty::before { content: attr(data-placeholder); color: var(--faint); }
.editor h2 { font-family: var(--font-serif); font-size: 20px; font-weight: 600; margin: 1.2em 0 .5em; line-height: 1.6; }
.editor h3 { font-size: 16px; font-weight: 700; margin: 1.1em 0 .4em; }
.editor h2:first-child, .editor h3:first-child { margin-top: 0; }
.editor p { margin: 0 0 .9em; }
.editor ul, .editor ol { margin: 0 0 1em 1.4em; }
.editor li { margin-bottom: .3em; }
.editor blockquote {
	margin: 1em 0; padding: 12px 18px; border-radius: var(--r-sm);
	background: var(--surface); box-shadow: var(--lift-sm); color: var(--muted); font-size: 13.5px;
}
.editor a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.editor img { max-width: 100%; height: auto; border-radius: var(--r-md); box-shadow: var(--lift-sm); margin: .6em 0; }
.editor s { color: var(--faint); }

/* 本文中の色（ブランドカラーに限定） */
.c-ink { color: #252936; }
.c-muted { color: #7F858E; }
.c-accent { color: #B87E22; }
.c-accent-soft { color: #D99A32; }
.c-white { color: #FFFFFF; }
.m-accent { background: rgba(217,154,50,.22); padding: 0 .15em; border-radius: 3px; }
.m-gray   { background: rgba(160,165,172,.20); padding: 0 .15em; border-radius: 3px; }

/* コメントを付けた箇所 */
.comment-anchor {
	background: rgba(217,154,50,.16);
	border-bottom: 2px solid rgba(217,154,50,.5);
	cursor: pointer; border-radius: 2px;
}
.comment-anchor.is-active { background: rgba(217,154,50,.34); }

/* ============================================================
   コメント
   ============================================================ */

/* 追従はさせない。sticky にすると、下にある公開前チェックと重なってしまう */
.cmt-panel { position: relative; }
.cmt-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.cmt-tab {
	flex: 1 1 auto; padding: 7px 10px; border: none; border-radius: 9px; cursor: pointer;
	background: var(--surface); box-shadow: var(--lift-sm);
	font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.cmt-tab.is-on { color: var(--accent-deep); box-shadow: var(--sink-sm); background: var(--sunken); }

/* ============================================================
   ワークスペース：原稿・画像・リターンなどをタブで切り替える
   （縦に並べると確認・入力のたびにスクロールが長くなるため）
   ============================================================ */
.work-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.work-tab {
	padding: 9px 16px; border: none; border-radius: var(--r-sm); cursor: pointer;
	background: var(--surface); box-shadow: var(--lift-sm);
	font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.work-tab.is-on { color: var(--accent-deep); box-shadow: var(--sink-sm); background: var(--sunken); }
.work-tab-panel[hidden] { display: none; }

.cmt-list { display: grid; gap: 12px; max-height: calc(100vh - 300px); overflow-y: auto; padding: 2px; }
.cmt { padding: 13px 15px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--lift-sm); }
.cmt.is-resolved { opacity: .6; }
.cmt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cmt-who { font-size: 12px; font-weight: 700; }
.cmt-time { font-size: 10.5px; color: var(--faint); margin-left: auto; font-family: var(--font-num); }
.cmt-body { font-size: 12.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.cmt-where { font-size: 10.5px; color: var(--accent-deep); font-weight: 700; margin-bottom: 5px; cursor: pointer; }
.cmt-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.cmt-replies { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--hairline); display: grid; gap: 9px; }
.cmt-reply-body { font-size: 12px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.cmt-form { margin-top: 10px; display: none; }
.cmt-form.is-open { display: block; }
.cmt-input {
	width: 100%; min-height: 60px; padding: 10px 12px; border: none; border-radius: var(--r-sm);
	background: var(--sunken); box-shadow: var(--sink-sm); font-size: 12.5px; line-height: 1.8; resize: vertical;
}
.cmt-input:focus { outline: none; box-shadow: var(--sink-sm), 0 0 0 2px var(--accent-tint); }
.cmt-empty { text-align: center; padding: 30px 12px; color: var(--faint); font-size: 12px; line-height: 2; }

/* ============================================================
   画像
   ============================================================ */

.drop {
	border-radius: var(--r-md); padding: 26px 20px; text-align: center;
	background: var(--sunken); box-shadow: var(--sink-sm);
	color: var(--muted); font-size: 12.5px; cursor: pointer;
	transition: box-shadow .15s ease, color .15s ease;
}
.drop:hover, .drop.is-over { color: var(--accent-deep); box-shadow: var(--sink-sm), 0 0 0 2px var(--accent-tint); }
.drop b { display: block; font-size: 13px; color: var(--text); margin-bottom: 3px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.asset { border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: var(--lift-sm); display: flex; flex-direction: column; }
.asset-thumb { aspect-ratio: 4 / 3; background: var(--sunken); display: grid; place-items: center; overflow: hidden; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-thumb .file-icon { font-size: 24px; color: var(--faint); }
.asset-body { padding: 10px 12px 12px; }
.asset-name { font-size: 11.5px; font-weight: 700; line-height: 1.5; word-break: break-all; }
.asset-meta { font-size: 10.5px; color: var(--faint); margin-top: 3px; line-height: 1.6; }
.asset-actions { display: flex; gap: 5px; margin-top: 9px; flex-wrap: wrap; }
.asset-actions .btn { padding: 4px 9px; font-size: 10.5px; border-radius: 7px; }

.filter-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
	padding: 7px 14px; border: none; border-radius: 999px; cursor: pointer;
	background: var(--surface); box-shadow: var(--lift-sm);
	font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.filter-chip.is-on { color: var(--accent-deep); box-shadow: var(--sink-sm); background: var(--sunken); }

/* ============================================================
   リターン
   ============================================================ */

.returns { display: grid; gap: 12px; }
.ret { border-radius: var(--r-md); background: var(--surface); box-shadow: var(--lift-sm); overflow: hidden; }
.ret.is-dragging { opacity: .45; }
.ret.is-over { box-shadow: var(--lift), 0 0 0 2px var(--accent-tint); }
.ret-head { display: flex; align-items: center; gap: 13px; padding: 14px 16px; cursor: pointer; }
.ret-no { font-family: var(--font-num); font-size: 15px; font-weight: 800; color: var(--accent); min-width: 1.8em; }
.ret-amount { font-family: var(--font-num); font-size: 15px; font-weight: 800; min-width: 5.5em; }
.ret-name { font-size: 13px; font-weight: 700; min-width: 0; flex: 1 1 auto; }
.ret-flags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ret-grip { cursor: grab; color: var(--faint); font-size: 13px; padding: 0 2px; }
.ret-grip:active { cursor: grabbing; }
.ret-body { display: none; padding: 4px 16px 18px; }
.ret.is-open .ret-body { display: block; }

/* ============================================================
   テーブル・リスト
   ============================================================ */

.table { width: 100%; border-collapse: collapse; }
.table th {
	font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--faint);
	text-align: left; padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid var(--hairline);
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; font-size: 12.5px; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-family: var(--font-num); font-weight: 700; }
.table-link { font-weight: 700; }
.table-link:hover { color: var(--accent-deep); }
.table-sub { display: block; font-size: 11px; color: var(--faint); line-height: 1.6; }
.table-wrap { overflow-x: auto; }

.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.list-row + .list-row { border-top: 1px solid var(--hairline); }
.list-main { min-width: 0; flex: 1 1 auto; }
.list-title { font-size: 12.5px; font-weight: 700; line-height: 1.6; }
.list-sub { font-size: 11px; color: var(--faint); line-height: 1.7; }
.list-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.timeline { display: grid; gap: 1px; }
.timeline-row { display: flex; gap: 12px; padding: 8px 0; font-size: 12px; line-height: 1.75; }
.timeline-time { flex: 0 0 46px; color: var(--faint); font-family: var(--font-num); font-size: 11px; padding-top: 1px; }
.timeline-who { font-weight: 700; }

.kv { display: grid; grid-template-columns: 8.5em 1fr; }
.kv dt { font-size: 11.5px; color: var(--faint); padding: 10px 0; border-top: 1px solid var(--hairline); }
.kv dd { padding: 10px 0; border-top: 1px solid var(--hairline); word-break: break-word; font-size: 12.5px; }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: none; }

.divider { border: 0; border-top: 1px solid var(--hairline); margin: 20px 0; }

/* ============================================================
   メッセージ
   ============================================================ */

.alert {
	display: flex; align-items: flex-start; gap: 10px;
	padding: 13px 16px; border-radius: var(--r-md);
	font-size: 12.5px; margin-bottom: 18px; line-height: 1.8;
	background: var(--surface); box-shadow: var(--lift-sm);
}
.alert-ok { color: var(--ok); }
.alert-error { color: var(--danger); }
.alert-warn { color: var(--warn); }
.alert-info { color: var(--info); }

.empty { text-align: center; padding: 38px 20px; color: var(--faint); font-size: 12.5px; line-height: 2; }
.empty-title { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--lift-sm); padding: 16px 18px; }
.stat-label { font-size: 11px; color: var(--faint); font-weight: 700; letter-spacing: .05em; }
.stat-value { font-family: var(--font-num); font-size: 25px; font-weight: 800; line-height: 1.3; margin-top: 2px; }
.stat-value.is-warn { color: var(--warn); }
.stat-value.is-danger { color: var(--danger); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters .input, .filters .select { width: auto; min-width: 160px; }

.password-box {
	font-family: var(--font-num); font-size: 17px; font-weight: 800; letter-spacing: .06em;
	background: var(--sunken); box-shadow: var(--sink-sm);
	border-radius: var(--r-sm); padding: 12px 16px; margin: 8px 0; user-select: all;
}

.check-list { display: grid; gap: 8px; }
.check-row {
	display: flex; align-items: flex-start; gap: 10px;
	padding: 11px 14px; border-radius: var(--r-sm);
	background: var(--surface); box-shadow: var(--lift-sm); font-size: 12.5px;
}
.check-row input { margin-top: 4px; width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }
.check-row.is-done { box-shadow: var(--sink-sm); background: var(--sunken); color: var(--muted); }
.check-row.is-done .check-label { text-decoration: line-through; }

/* ============================================================
   ログイン・セットアップ
   ============================================================ */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift-lg); padding: 38px 34px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-title { font-family: var(--font-serif); font-size: 21px; font-weight: 600; line-height: 1.5; }
.auth-sub { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.85; }
.auth-foot { text-align: center; font-size: 11px; color: var(--faint); margin-top: 22px; }

/* ============================================================
   レスポンシブ
   ============================================================ */

@media (max-width: 1200px) {
	.grid-work { grid-template-columns: minmax(0, 1fr); }
	.cmt-panel { position: static; }
	.cmt-list { max-height: 420px; }
}

@media (max-width: 1000px) {
	.grid-3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
	.stat-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}

@media (max-width: 860px) {
	.layout { flex-direction: column; }
	.sidebar {
		width: 100%; flex: none; height: auto; position: static;
		padding: 12px 14px; display: flex; align-items: center; gap: 8px; overflow-x: auto;
	}
	.sidebar .brand { padding: 0 10px 0 4px; flex: 0 0 auto; }
	.brand-name small { display: none; }
	.nav-group { margin-bottom: 0; display: flex; gap: 6px; flex: 0 0 auto; }
	.nav-label { display: none; }
	.nav-item { white-space: nowrap; margin-bottom: 0; padding: 8px 13px; font-size: 12px; }
	.header { padding: 0 14px; gap: 10px; }
	/* 名前は折り返すと2行になって崩れるので、狭い画面ではアイコンだけにする */
	.header-user span:not(.avatar) { display: none; }
	.content { padding: 8px 16px 70px; }
	.page-title { font-size: 21px; }
	.panel, .well { padding: 18px 17px; border-radius: var(--r-md); }
	.grid-2, .grid-3, .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); }
	.stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
	.kv { grid-template-columns: 1fr; }
	.kv dt { padding: 10px 0 0; }
	.kv dd { padding: 0 0 10px; border-top: none; }
	.ready-row { grid-template-columns: 7em 1fr; }
	.ready-value { grid-column: 2; text-align: left; min-width: 0; margin-top: -4px; }
	.gantt-row { grid-template-columns: 7.5em 1fr 22px; }
	.gallery { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 11px; }
	.ret-head { flex-wrap: wrap; gap: 9px; }
	.ret-name { flex-basis: 100%; order: 3; }
	.editor { padding: 16px 15px; font-size: 14px; }
	.toolbar { padding: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation-duration: 2s !important; }
}

/* ============================================================
   旧クラス名の互換
   ------------------------------------------------------------
   ワークスペースで .panel / .tag / .progress-track に整理したが、
   ダッシュボード・一覧・フォームなどの画面はまだ旧名を使っている。
   同じ見た目になるよう対応づける（順次、新しい名前へ寄せていく）。
   ============================================================ */

.card {
	background: var(--surface); border-radius: var(--r-lg);
	box-shadow: var(--lift); padding: 26px 28px; margin-bottom: 22px;
}
.card.is-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.card-title small { font-weight: 400; color: var(--faint); font-size: 11.5px; margin-left: 9px; }
.card-action { margin-left: auto; font-size: 12px; color: var(--accent-deep); font-weight: 700; }

.grid-main { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); align-items: start; }

.pill {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 4px 12px; border-radius: 999px;
	font-size: 11px; font-weight: 700; line-height: 1.7; white-space: nowrap;
	background: var(--surface); color: var(--muted); box-shadow: var(--lift-sm);
}
.pill-gray   { color: var(--muted); }
.pill-blue   { color: var(--info); }
.pill-orange { color: var(--warn); }
.pill-green  { color: var(--ok); }
.pill-red    { color: var(--danger); }

.progress-bar {
	flex: 1 1 auto; height: 8px; border-radius: 999px; min-width: 60px;
	background: var(--sunken); box-shadow: var(--sink-sm); overflow: hidden;
}

.btn-quiet { box-shadow: none; background: transparent; color: var(--muted); }
.btn-quiet:hover { box-shadow: var(--lift-sm); background: var(--surface); }

.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step {
	display: flex; align-items: center; gap: 7px;
	padding: 7px 13px; border-radius: 999px; font-size: 11.5px;
	background: var(--surface); box-shadow: var(--lift-sm); color: var(--muted);
}
.step.is-done    { color: var(--ok); }
.step.is-current { color: var(--accent-deep); font-weight: 700; box-shadow: var(--sink-sm); background: var(--sunken); }

@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px)  { .card { padding: 18px 17px; border-radius: var(--r-md); } }

/* ============================================================
   制作の段階（CAMPFIREの編集画面と同じ並び）
   ============================================================ */

.stage-bar {
	display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
	background: var(--surface); border-radius: var(--r-lg);
	box-shadow: var(--lift); padding: 14px 18px; margin-bottom: 22px;
}
.stage { display: flex; align-items: center; gap: 11px; padding: 6px 14px 6px 6px; min-width: 0; }
.stage + .stage { border-left: 1px solid var(--hairline); padding-left: 18px; }
.stage-no {
	width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
	background: var(--sunken); box-shadow: var(--sink-sm);
	display: grid; place-items: center;
	font-family: var(--font-num); font-size: 12px; font-weight: 800; color: var(--faint);
}
.stage-body { display: grid; min-width: 0; }
.stage-name { font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.5; }
.stage-note { font-size: 10.5px; color: var(--faint); line-height: 1.6; }
.stage.is-current .stage-no {
	background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff;
	box-shadow: 2px 2px 6px rgba(184,126,34,.28);
}
.stage.is-current .stage-name { color: var(--accent-deep); }
.stage.is-done .stage-no { color: var(--accent-deep); box-shadow: var(--lift-sm); background: var(--surface); }
.stage.is-done .stage-name { color: var(--text); }
.stage-links { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   パスワード入力（目のアイコン）
   ============================================================ */

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; letter-spacing: .06em; }
.pw-eye {
	position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
	width: 32px; height: 32px; border: none; border-radius: 9px;
	background: transparent; cursor: pointer; font-size: 14px; line-height: 1;
	color: var(--muted); opacity: .7;
	display: grid; place-items: center;
}
.pw-eye:hover { opacity: 1; background: var(--surface); box-shadow: var(--lift-sm); }
.pw-eye.is-on { opacity: 1; color: var(--accent-deep); box-shadow: var(--sink-sm); background: var(--sunken); }

/* ============================================================
   削除
   ============================================================ */

.nav-item.is-danger { color: var(--danger); opacity: .85; }
.nav-item.is-danger:hover { color: var(--danger); opacity: 1; }

/* 通常のCTAとは明確に区別する。ただし全体から浮かない控えめな赤 */
.btn-delete {
	background: var(--surface); color: var(--danger);
	box-shadow: var(--lift-sm), inset 0 0 0 1px rgba(180,83,74,.22);
}
.btn-delete:hover:not(:disabled) {
	color: #fff; background: #B4534A;
	box-shadow: 3px 3px 9px rgba(180,83,74,.28), -3px -3px 9px var(--sh-light);
}
.btn-delete:disabled { color: var(--faint); box-shadow: var(--sink-sm); background: var(--sunken); }

/* ============================================================
   通知センター
   ============================================================ */

.bell-wrap { position: relative; }
.bell {
	border: none; background: transparent; cursor: pointer;
	position: relative; font-size: 15px; color: var(--muted); line-height: 1;
	width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
}
.bell:hover { background: var(--surface); box-shadow: var(--lift-sm); }

.notif {
	position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
	width: 380px; max-width: calc(100vw - 32px);
	background: var(--surface); border-radius: var(--r-lg);
	box-shadow: var(--lift-lg); overflow: hidden;
}
.notif-head {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 16px 12px; border-bottom: 1px solid var(--hairline);
}
.notif-title { font-size: 13.5px; font-weight: 700; }
.notif-head .btn { margin-left: auto; }
.notif-body { max-height: 60vh; overflow-y: auto; }
.notif-foot {
	padding: 11px 16px; border-top: 1px solid var(--hairline);
	font-size: 11.5px; text-align: center;
}
.notif-foot a { color: var(--accent-deep); font-weight: 700; }

.notif-group + .notif-group { border-top: 1px solid var(--hairline); }
.notif-group-title {
	font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--faint);
	padding: 12px 16px 6px;
}
.notif-group-title.is-action { color: var(--accent-deep); }
.notif-group-title b { font-family: var(--font-num); font-size: 11px; }

.notif-list { display: grid; }
.notif-item {
	display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px;
	align-items: start; padding: 11px 16px;
	border-top: 1px solid var(--hairline);
}
.notif-list .notif-item:first-child { border-top: none; }
.notif-item:hover { background: rgba(255,255,255,.5); }
.notif-item.is-unread { background: rgba(217,154,50,.06); }
.notif-item.is-unread .notif-text { font-weight: 700; }
.notif-type {
	font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
	color: var(--muted); background: var(--sunken); box-shadow: var(--sink-sm);
	border-radius: 999px; padding: 3px 9px; white-space: nowrap; margin-top: 2px;
}
.notif-item.is-unread .notif-type { color: var(--accent-deep); }
.notif-main { min-width: 0; display: grid; gap: 2px; }
.notif-text { font-size: 12.5px; line-height: 1.65; }
.notif-sub {
	font-size: 11px; color: var(--muted); line-height: 1.6;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-proj { font-size: 10.5px; color: var(--faint); }
.notif-time { font-size: 10.5px; color: var(--faint); font-family: var(--font-num); white-space: nowrap; margin-top: 2px; }
.notif-empty { padding: 34px 20px; text-align: center; color: var(--faint); font-size: 12px; line-height: 2; }

@media (max-width: 620px) {
	.notif { width: calc(100vw - 24px); right: -8px; }
	.notif-item { grid-template-columns: 1fr auto; }
	.notif-type { grid-column: 1 / -1; justify-self: start; }
}

/* 表の中の小さな入力欄（タスクの担当・期限・状態） */
.select-inline {
	width: auto; min-width: 7em; max-width: 100%;
	padding: 6px 10px; font-size: 11.5px; border-radius: 8px;
}
.select-inline[type="date"] { min-width: 9.5em; font-family: var(--font-num); }

/* ============================================================
   AIアシスト（リターン提案）
   ============================================================ */

.ai-list { display: grid; gap: 12px; }
.ai-item {
	border-radius: var(--r-md); background: var(--surface); box-shadow: var(--lift-sm);
	padding: 16px 18px;
}
.ai-item.is-held    { opacity: .62; }
.ai-item.is-adopted { box-shadow: var(--sink-sm); background: var(--sunken); }
.ai-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-amount { font-family: var(--font-num); font-size: 16px; font-weight: 800; color: var(--accent); min-width: 5.5em; }
.ai-name { font-size: 13.5px; font-weight: 700; flex: 1 1 auto; min-width: 0; }
.ai-content { font-size: 12.5px; line-height: 1.9; color: var(--ink, var(--text)); }
.ai-meta { display: grid; gap: 5px; margin-top: 10px; }
.ai-meta span { font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.ai-meta b {
	display: inline-block; min-width: 6em; font-size: 10px; font-weight: 700;
	letter-spacing: .08em; color: var(--faint); margin-right: 8px;
}
.ai-edit { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.ai-actions { display: flex; gap: 7px; margin-top: 13px; flex-wrap: wrap; align-items: center; }

@media (max-width: 620px) {
	.ai-amount { min-width: 0; }
	.ai-name { flex-basis: 100%; }
	.ai-meta b { display: block; min-width: 0; margin-bottom: 2px; }
}

/* ============================================================
   モーダル（原稿の履歴）
   面の色は背景と同じまま、影だけで浮かせる。白いカードは出さない。
   ============================================================ */

.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(37,41,54,.28); }

.modal-box {
	/* 高さを決め打ちにする。中身の量で高さが変わると、
	   履歴を選ぶたびに枠が伸び縮みして読みにくいため。 */
	position: relative; width: min(1000px, 100%); height: min(660px, calc(100vh - 48px));
	display: flex; flex-direction: column;
	background: var(--surface); border-radius: var(--r-lg); padding: 22px 24px;
	box-shadow: var(--lift-lg);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.modal-title { font-family: var(--font-serif); font-size: 19px; font-weight: 600; }

.modal-body {
	flex: 1; min-height: 0;
	display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px;
}

/* 左：保存の一覧 */
.history-list { overflow-y: auto; min-height: 0; display: grid; gap: 8px; align-content: start; padding-right: 2px; }
.history-item {
	width: 100%; text-align: left; cursor: pointer;
	background: var(--surface); border: 0; border-radius: var(--r-sm);
	padding: 10px 12px; box-shadow: var(--lift-sm);
	font-family: var(--font); color: var(--text); line-height: 1.7;
}
.history-item:hover { box-shadow: var(--lift); }
.history-item.is-active { box-shadow: var(--sink-sm); color: var(--accent-deep); }
.history-item .no { font-family: var(--font-num); font-size: 12px; color: var(--faint); }
.history-item .who { font-size: 13px; font-weight: 600; }
.history-item .when { font-size: 11px; color: var(--muted); }
.history-item .note { font-size: 11px; color: var(--accent-deep); margin-top: 2px; }

/* 右：そのときの内容 */
.history-preview { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.history-preview-head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	flex-wrap: wrap; margin-bottom: 10px; min-height: 32px;
}
.editor.is-preview { border-radius: var(--r-md); overflow-y: auto; flex: 1; min-height: 0; }

@media (max-width: 820px) {
	.modal { padding: 12px; }
	.modal-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
	.history-list { max-height: 180px; }
}

/* ============================================================
   資金の使い道
   ============================================================ */

.funds { display: grid; gap: 12px; }
.fund {
	background: var(--surface); border-radius: var(--r-md);
	padding: 12px 14px; box-shadow: var(--lift-sm);
	display: grid; gap: 8px;
}
.fund-main { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; align-items: center; }
.fund-amount { text-align: right; font-family: var(--font-num); }

.fund-total {
	margin-top: 16px; padding: 14px 18px;
	background: var(--sunken); border-radius: var(--r-md); box-shadow: var(--sink-sm);
}
.fund-total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.fund-total-row b { font-family: var(--font-num); font-size: 18px; font-weight: 700; }
.fund-total-row.is-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 目標金額との差。ぴったりなら控えめ、ずれているときだけ色を出す */
.fund-diff { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.fund-diff.is-over  { color: var(--danger); font-weight: 700; }
.fund-diff.is-under { color: var(--warn); font-weight: 700; }
.fund-diff.is-match { color: var(--ok); font-weight: 700; }

@media (max-width: 700px) {
	.fund-main { grid-template-columns: minmax(0, 1fr); }
	.fund-amount { text-align: left; }
}

/* ============================================================
   クライアントのプロフィール
   ============================================================ */

/* hidden 属性を必ず効かせる。
   .btn などが display を持っているため、hidden だけでは消えない。 */
[hidden] { display: none !important; }

.profile-grid { align-items: start; }
.profile-photo { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-photo-frame {
	width: 128px; height: 128px; flex: none;
	border-radius: 50%; overflow: hidden;
	background: var(--sunken); box-shadow: var(--sink);
	display: flex; align-items: center; justify-content: center;
}
.profile-photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-photo-empty { font-size: 11px; color: var(--faint); text-align: center; padding: 0 12px; line-height: 1.7; }
.profile-photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.profile-photo-actions .btn { cursor: pointer; }

/* ============================================================
   承認状況
   ============================================================ */

.approvals { display: grid; gap: 12px; }
.approval {
	background: var(--surface); border-radius: var(--r-md);
	padding: 14px 16px; box-shadow: var(--lift-sm);
	display: grid; gap: 10px;
	scroll-margin-top: calc(var(--header-h) + 18px);
}
.approval.is-approved { box-shadow: var(--lift-sm), inset 0 0 0 1px rgba(78,138,107,.22); }
.approval.is-changes  { box-shadow: var(--lift-sm), inset 0 0 0 1px rgba(185,132,40,.28); }

.approval-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.approval-name { font-size: 13.5px; font-weight: 700; }
.approval-name a { color: inherit; text-decoration: none; }
.approval-name a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.approval-round { font-size: 11px; color: var(--faint); font-family: var(--font-num); }
.approval-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* 確認者。誰がまだ見ていないかが一目で分かるようにする */
.approval-reviewers { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.approval-reviewer {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 11.5px; padding: 4px 10px 4px 5px; border-radius: 999px;
	background: var(--sunken); box-shadow: var(--sink-sm); color: var(--muted);
}
.approval-reviewer .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.approval-reviewer.is-ok      { color: var(--ok); }
.approval-reviewer.is-ok .dot { background: var(--ok); }
.approval-reviewer.is-changes      { color: var(--warn); }
.approval-reviewer.is-changes .dot { background: var(--warn); }
.approval-reviewer .when { color: var(--faint); font-size: 10.5px; }
.approval-reviewer.is-optional { opacity: .65; }

.approval-meta { font-size: 11px; color: var(--faint); line-height: 1.8; }
.approval-note {
	font-size: 12px; color: var(--text); line-height: 1.85;
	background: var(--sunken); box-shadow: var(--sink-sm);
	border-radius: var(--r-sm); padding: 9px 12px;
}
.approval-note b { color: var(--warn); }

/* 確認者を選ぶ欄（管理者のみ） */
.approval-pick { display: none; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.approval-pick.is-open { display: flex; }

.approval-empty { font-size: 12px; color: var(--faint); }

@media (max-width: 700px) {
	.approval-actions { margin-left: 0; width: 100%; }
}
