/* schedule.css - レイアウトとUIスタイルを集約 */
/* デザイン変数（カラム幅・色・固定ヘッダ寸法） */
:root {
	--border: #000000;
	--line-soft: #cfd4dc;
	--line-mid: #ddd;
	--line-light: #e5e5e5;
	--surface-white: #fff;
	--surface-tab-active: #cfead8;
	--day-width: 3.5rem;
	--col-company: 140px;
	--col-date: 130px;
	--col-text: 320px;
	--col-est: 120px;
	--col-income: 120px;
	--col-summary: 55px;
	--scroll-tail-right: 0px;
	--scroll-tail-bottom: 0px;
	--toolbar-height: 45px;
	--column-head-height: 42px;
	--header-title-height: 60px;
	--plan-mark: #111;
	--actual-mark: #0f67b1;
	--btn-blue: #2b8cf5;
	--btn-blue-dark: #1f6fcc;
	--btn-navy: #1f2f55;
	--btn-navy-dark: #14223f;
	--btn-green: #52d298;
	--btn-green-dark: #3bbf82;
	--btn-orange: #f5a046;
	--btn-orange-dark: #e1872c;
	--btn-red: #f76c6c;
	--btn-red-dark: #d44e4e;
	--sunday-bg: #FD9DA3;
	--saturday-bg: #B9DFFD;
	--dialog-label-width: 120px;
	--font-size: initial;
}

/* main.css 由来の既定余白を打ち消し、行内ラベルの高さ揃えを優先 */
.f-row > label:not(.def-label), .label:not(h1, h2, h3, h4, h5, h6) {
	margin: 0;
}
* { box-sizing: border-box; }
html { font-size: 100%; height: 100%; }
body {
	font-family: 'Noto Sans JP', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
	font-size: 1.05rem; /* up from ~16px → ~16.8px */
	line-height: 1.65;
	background: #f7f7f7;
	color: #222;
	min-height: 100%;
	display: flex;
	flex-direction: column;
}
.app.fixed-footer.mt-0 {
	display: flex;
	flex-direction: column;
	/* main.css の固定フッター用 margin を打ち消し、表示領域内で完結させる */
	margin-bottom: 0;
	min-height: calc(100vh - var(--fixed-footer-advertising));
	min-height: calc(100dvh - var(--fixed-footer-advertising));
	height: calc(100vh - var(--fixed-footer-advertising));
	height: calc(100dvh - var(--fixed-footer-advertising));
}
#calendar-container {
	margin-inline: 14px;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	display: flex;
}

/* タイトルと検索バー */
.page-title {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-align: left; /* main.css の h1 中央寄せを上書き */
	flex: 0 1 auto;
	white-space: nowrap;
}
.page-title-bar {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 12px;
	padding: 0 10px;
	min-height: var(--header-title-height);
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
}
.group-select {
	min-width: 180px;
	flex: 0 0 220px;
	max-width: 100%;
	padding: 6px 10px;
	border: 1px solid var(--line-soft);
	border-radius: 4px;
	background: var(--surface-white);
	font-size: 0.95rem;
	line-height: 1.3;
}
/* グループセレクト右側に配置するPDFボタンの表示を揃える */
.btn.page-title-pdf-btn {
	flex: 0 0 auto;
	height: 32px;
	padding: 0 12px;
	font-size: 1rem;
	line-height: 1;
	border-radius: 10px;
}
#message-area {
	position: fixed;
	top: 8px;
	left: 10px;
	z-index: 1200;
	max-width: min(560px, calc(100vw - 20px));
	margin: 0;
	min-height: 0;
	padding: 10px 12px;
	background: var(--surface-white);
	border: 1px solid var(--line-soft);
	border-radius: 8px;
	box-shadow: 0 8px 20px rgba(0,0,0,0.16);
	font-size: 0.95rem;
	line-height: 1.45;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.18s ease, transform 0.18s ease;
}
#message-area:empty {
	opacity: 0;
	transform: translateY(-8px);
}
#message-area.notice-msg {
	background-color: #FFFFFF;
	color: #000000;
}
#message-area.warn-msg {
	background-color: #FFFFCC;
	color: #FF0000;
}
#message-area.err-msg {
	background-color: #ffe5e2;
	color: #FF0000;
}
.toolbar {
	margin: 0 0 10px 0;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid var(--border);
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	align-items: center;
}
.toolbar label {
	font-size: 0.98rem;
	font-weight: 600;
	margin-right: 6px;
}
.toolbar input[type="date"],
.toolbar select {
	padding: 6px 8px;
	font-size: 1rem;
	border: 1px solid var(--line-soft);
	border-radius: 6px;
}
.toolbar .btn {
	padding: 6px 12px;
	font-size: 1rem;
	border-radius: 12px;
}
.btn.search { border-color: #0f67b1; background: linear-gradient(180deg, #2185d0 0%, #0f67b1 100%); color: #fff; }
.btn.new { border-color: var(--btn-blue-dark); background: linear-gradient(180deg, var(--btn-blue) 0%, var(--btn-blue-dark) 100%); color: #fff; }
.btn.save { border-color: var(--btn-navy-dark); background: linear-gradient(180deg, var(--btn-navy) 0%, var(--btn-navy-dark) 100%); color: #fff; }

/* レイアウト（左固定＋横スクロール） */
.calendar-pane {
	background: #fff;
	border: 1px solid var(--border);
	padding: 8px 10px 12px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	position: relative;
	display: flex;
	width: 100%;
	min-width: 0;
	min-height: 0;
	flex: 1 1 auto;
	gap: 0;
	align-items: stretch;
	/* 高さは親コンテナの flex で確定させ、スクロールは .scroll-wrap へ委譲 */
	max-height: none;
}
.scroll-wrap {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	min-height: 0;
	overflow-x: auto;
	overflow-y: auto;
}
#js-rows {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}
/* 下端の見切れ防止余白。固定フッター/OSバーにセルが隠れないようにする */
.pane-body {
	padding: 0 var(--scroll-tail-right) calc(3rem + var(--scroll-tail-bottom)) 0;
	background: #fff;
	position: relative;
	width: max-content;
	min-width: 100%;
}

/* グリッド（ヘッダ3行＋データ行） */
.grid-row {
	display: grid;
	grid-template-columns:
		var(--col-company)
		var(--col-date)
		var(--col-text)
		var(--col-est)
		var(--col-income)
		var(--col-summary)
		repeat(var(--day-count), var(--day-width));
	min-width: calc(
		var(--col-company) + var(--col-date) + var(--col-text) +
		var(--col-est) + var(--col-income) + var(--col-summary) +
		(var(--day-width) * var(--day-count))
	);
	background: #fff;
	position: relative;
	z-index: 2;
}
/* 実データ行のみ 2px 開けて視認性を確保。ヘッダ行は隙間を作らない */
.grid-row { margin-top: 2px; }
.grid-row.is-header { margin-top: 0; }
.grid-row.is-header + .grid-row.is-header { margin-top: 0; }
.timeline.actual { margin-top: 0; }
.grid-row.timeline.actual > * { border-top: 0; }
.grid-row.total-row {
	margin-top: 0;
	padding-top: 2px;
}
#js-rows.fill-bottom .grid-row.total-row.total-row-first { margin-top: auto; }
.grid-row.total-row.is-sticky {
	position: sticky;
	bottom: 0;
	z-index: 5;
	box-shadow: 0 -2px 6px rgba(0,0,0,0.08);
}
.grid-row.total-row .cell {
	background: #fffbe8;
	font-weight: 700;
}
.grid-row.total-row.is-selected .cell {
	background: #FBA366;
}
.grid-row.total-row .cell.company {
	justify-content: center;
	text-align: center;
}
.grid-row.total-row .cell.text.col-text {
	cursor: pointer;
}
.grid-row.total-row .cell.text.col-text:hover {
	background: #FBA366;
}
.grid-row.total-row.is-selected .cell.text.col-text {
	cursor: default;
}
.grid-row.total-row.is-selected .cell.text.col-text:hover {
	background: #FBA366;
}
.grid-row.total-row .cell.total-day {
	text-align: center;
}

/* stickyヘッダの積み上げ順を固定（年月 -> 列名 -> 曜日） */
.month-row {
	position: sticky;
	top: 0;
	z-index: 8;
	background: #fff;
	min-height: var(--toolbar-height);
}
.head.month-head {
	position: relative;
	z-index: 5;
	text-align: left;
	padding-left: 10px;
	background: #f5f5f5;
}
.month-head-pinned {
	position: absolute;
	top: 0;
	z-index: 9;
	display: flex;
	align-items: center;
	min-height: var(--toolbar-height);
	padding: 8px 10px;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.45;
	background: #f5f5f5;
	border: 1px solid var(--border);
	border-left: none;
	border-right: none;
	box-shadow: none;
	pointer-events: none;
	white-space: nowrap;
	transform: translateX(0);
	/* 左固定列ぶん右へ寄せて日付ヘッダ開始列に合わせる */
	left: calc(
		var(--col-company) +
		var(--col-date) +
		var(--col-text) +
		var(--col-est) +
		var(--col-income) +
		var(--col-summary)
	);
}
.month-head-pinned::after {
	content: '';
	position: absolute;
	top: 1px;
	right: -2px;
	width: 4px;
	height: calc(100% - 2px);
	background: #f5f5f5;
	pointer-events: none;
}
/* 共通の末尾セル罫線指定より優先して、固定月ラベル右罫線を非表示化 */
.month-row > .month-head-pinned:last-child {
	border-right: none;
}
.grid-row.is-header.column-header-row {
	position: sticky;
	top: var(--toolbar-height);
	z-index: 7;
	background: #fff;
	min-height: var(--column-head-height);
}
.grid-row.is-header.column-header-row + .grid-row.is-header {
	position: sticky;
	/* 列名ヘッダ高ぶん下に積む */
	top: calc(var(--toolbar-height) + var(--column-head-height));
	z-index: 6;
	background: #fff;
}
.head.toolbar-head {
	position: sticky;
	top: 0;
	z-index: 7;
}

.sticky {
	position: sticky;
	left: 0;
	z-index: 4;
	background: #fff;
	box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}

.cell, .head {
	border: 1px solid var(--border);
	border-left: none;
	padding: 8px 5px;
	line-height: 1.45;
	font-size: 1.125rem;
	background: #fff;
}
/* ヘッダの線を整える */
.grid-row.is-header > * { border-bottom: 1px solid var(--border); }
.grid-row.is-header + .grid-row.is-header > * { border-top: 0; }
/* ヘッダの二重線を防ぐ: 上から順に1本だけ残す */
.grid-row.is-header:not(#js-dow-row) > * { border-bottom: 0; }
.grid-row.is-header:not(:first-of-type) > *:first-child { border-left: 0; }
.grid-row.is-header:not(:first-of-type) > *:last-child  { border-right: 0; }
/* 固定列ヘッダの上線も二重にならないようにする */
.grid-row.is-header:not(:first-of-type) > .head.sticky { border-top: 0; }
/* 左右の枠を確実に描く */
.grid-row > *:first-child { border-left: 1px solid var(--border); }
.grid-row > *:last-child  { border-right: 1px solid var(--border); }

.head { font-weight: 700; text-align: center; background: #f5f5f5; }
.head.col-company.js-company-sort {
	cursor: pointer;
	user-select: none;
}
.head.col-company.js-company-sort.is-company-sort-asc {
	background: #F0F8FF;
}
.head.col-company.js-company-sort.is-company-sort-desc {
	background: #FEEEED;
}
.action-head {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px 6px;
	gap: 6px;
}
.action-head .btn {
	flex: 1 1 0;
	justify-content: center;
}
.day-number, .dow {
	text-align: center;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.45;
	padding: 8px 5px;
	border: 1px solid var(--border);
	border-left: none;
}
.day-number[data-date], .dow[data-date] {
	cursor: pointer;
}
.sun { background: var(--sunday-bg); }
.sat { background: var(--saturday-bg); }

.dot {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--plan-mark);
	display: block;
	margin: 0 auto;
}
.timeline.actual .dot { background: var(--actual-mark); }
.cell.slot { min-height: 24px; position: relative; }
.cell.slot .slot-select {
	width: 100%;
	font-size: 0.95rem;
	border: 1px solid var(--line-soft);
	border-radius: 4px;
	background: #fff;
}
.cell.slot.in-plan-range { background: #FBDF66; }
.cell.actions { padding: 4px; display: flex; gap: 6px; align-items: center; }
.cell.money-label { text-align: center; font-weight: 700; background: #f3f3f3; }
.cell.money-value { text-align: right; font-weight: 700; }
.cell.company {
	text-align: left;
	font-weight: 700;
	display: flex;
	flex-direction: column;
	gap: 6px;
	justify-content: center;
}
.cell.company .company-line,
.cell.text .text-line {
	display: block;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
}
.cell.text .text-line.sub {
	display: block;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
}
.cell.company .company-line { font-weight: 700; }
.cell.company .action-line {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}
.cell.date {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 2px;
	padding-top: 4px;
	padding-bottom: 4px;
	text-align: left;
}
.date-line { line-height: 1.25; }
.date-line.plan { color: var(--plan-mark); font-weight: 700; }
.date-line.actual { color: var(--actual-mark); font-weight: 700; }
.cell.amount { text-align: right; }
.cell.money {
	display: flex;
	flex-direction: column;
	gap: 3px;
	background: #fafafa;
}
.cell.label,
.cell.summary {
	text-align: center;
	font-weight: 700;
	background: #fffaf2;
}
.timeline.actual .cell.label,
.timeline.actual .cell.summary {
	background: #f8fbff;
}
.money-line.status { font-weight: 700; text-align: left; }
.money-line.amount { text-align: right; font-weight: 700; }
.cell.text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	justify-content: center;
}
.text-line { line-height: 1.35; }

/* 固定列の位置（inline style を排除） */
.col-company { left: 0; }
.col-date { left: var(--col-company); }
.col-text { left: calc(var(--col-company) + var(--col-date)); }
/* 各列のleftは左側列の合計値で算出し、DOM順変更時の保守を容易にする */
.col-est,.col-status { left: calc(var(--col-company) + var(--col-date) + var(--col-text)); }
.col-income { left: calc(var(--col-company) + var(--col-date) + var(--col-text) + var(--col-est)); }
.col-summary { left: calc(var(--col-company) + var(--col-date) + var(--col-text) + var(--col-est) + var(--col-income)); }

.head.col-est.span2 { grid-column: span 2; }

/* ボタン共通 */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0 12px;
	border-radius: 12px;
	border: 1px solid transparent;
	background: linear-gradient(180deg, #fff 0%, #f3f3f3 100%);
	color: #2b2b2b;
	font-size: 0.98rem;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.12s ease;
	white-space: nowrap;
	cursor: pointer;
}

/* ヘッダ内に収めるインライン版ツールバー */
.toolbar-inline {
	margin: 0;
	padding: 0;
	width: 100%;
	background: transparent;
	border: none;
	box-shadow: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}
.page-title-toolbar {
	margin-left: auto;
	flex: 0 0 auto;
	min-width: 0;
	width: auto;
	max-width: none;
	justify-content: flex-end;
	gap: 6px 8px;
	flex-wrap: nowrap;
	overflow: visible;
}
.page-title-toolbar > div {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	flex: 0 0 auto;
}
.page-title-toolbar input[type="date"] {
	width: 148px;
}
.page-title-toolbar select {
	width: 104px;
}
.page-title-toolbar .toolbar-end-wrap input[type="date"] {
	min-width: 0;
}
.toolbar-head {
	padding: 2px 4px;
	display: flex;
	align-items: center;
	justify-content: flex-start;
}
.toolbar-inline .toolbar-actions {
	display: inline-flex;
	gap: 8px;
}
.toolbar-inline .toolbar-month-shift {
	display: inline-flex;
	align-items: center;
}
.toolbar-inline .toolbar-range-separator {
	font-weight: 700;
	font-size: 1rem;
	line-height: 1;
}
.toolbar-inline .btn.month-shift {
	border-radius: 10px;
	height: 32px;
}
.toolbar-inline label { margin-right: 6px; }
.toolbar-inline input[type="date"] { padding: 5px 7px; }
.toolbar-inline .btn { border-radius: 10px; }

.column-visibility-area {
	position: relative;
	display: inline-flex;
	align-items: center;
}
.column-visibility-toggle {
	height: 30px;
	padding: 0 10px;
	font-size: 0.9rem;
}
.column-visibility-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 140px;
	padding: 8px 10px;
	border: 1px solid var(--line-soft);
	border-radius: 8px;
	background: var(--surface-white);
	box-shadow: 0 6px 14px rgba(0,0,0,0.16);
	z-index: 12;
}
.column-visibility-option {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	line-height: 1.4;
	padding: 2px 0;
	cursor: pointer;
}
.column-visibility-option input {
	margin: 0;
}
.js-col-toggle {
	cursor: pointer;
	user-select: none;
}

/* 固定列の表示/非表示切替
 * display:none にすると grid の自動配置が詰まり列順が崩れるため、
 * 要素は残したままトラック幅0 + 視覚非表示で対応する。 */
.calendar-pane.is-hide-date .col-date,
.calendar-pane.is-hide-text .col-text,
.calendar-pane.is-hide-status .col-status,
.calendar-pane.is-hide-status .col-est,
.calendar-pane.is-hide-status .col-income,
.calendar-pane.is-hide-summary .col-summary {
	visibility: hidden;
	pointer-events: none;
	width: 0;
	min-width: 0;
	max-width: 0;
	padding: 0;
	border-width: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: 0;
	line-height: 0;
}
.calendar-pane.is-hide-date .col-date > *,
.calendar-pane.is-hide-text .col-text > *,
.calendar-pane.is-hide-status .col-status > *,
.calendar-pane.is-hide-status .col-est > *,
.calendar-pane.is-hide-status .col-income > *,
.calendar-pane.is-hide-summary .col-summary > * {
	display: none !important;
}
/* ローディング中の連打防止 + スピナー描画 */
.btn.loading {
	opacity: 0.72;
	pointer-events: none;
	position: relative;
}
.btn.loading::after {
	content: '';
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,0.6);
	border-top-color: rgba(255,255,255,1);
	animation: spin 0.9s linear infinite;
}
@keyframes spin {
	to { transform: rotate(360deg); }
}
.btn.green  { border-color: var(--btn-green-dark);  background: linear-gradient(180deg, var(--btn-green) 0%, var(--btn-green-dark) 100%); color: #fff; }
.btn.orange { border-color: var(--btn-orange-dark); background: linear-gradient(180deg, var(--btn-orange) 0%, var(--btn-orange-dark) 100%); color: #fff; }
.btn.red    { border-color: var(--btn-red-dark);    background: linear-gradient(180deg, var(--btn-red) 0%, var(--btn-red-dark) 100%); color: #fff; }
.btn:hover {
	text-decoration: none;
	filter: brightness(1.05);
	box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.btn.green:hover,
.btn.orange:hover,
.btn.red:hover,
.btn.search:hover,
.btn.new:hover,
.btn.save:hover {
	color: #fff;
}
.btn svg { width: 12px; height: 12px; }
.btn.ghost { background: var(--surface-white); border: 1px solid var(--line-soft); color: #333; }

/* モーダル (dialog要素) */
dialog {
	border: none;
	padding: 0;
	background: #FFFFFF;
	max-width: 100%;
	display: none;
}
dialog[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}
dialog::backdrop {
	background: rgba(0,0,0,0.35);
	backdrop-filter: blur(1px);
}
.dialog {
	background: #fff;
	width: 520px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	overflow-y: auto; /* ヘッダstickyを効かせるため親をスクロールコンテナに */
	overflow-x: hidden;
}
.dialog header {
	padding: 12px 16px 8px;
	font-weight: 700;
	border-bottom: 1px solid var(--line-light);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	position: sticky;
	top: 0;
	z-index: 6;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.dialog .dialog-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.dialog .body {
	padding: 14px 16px 10px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1 1 auto;
	overflow: visible; /* スクロールは親(.dialog)に任せる */
	min-height: 0; /* enable scrolling inside flex parent */
	background: #fff;
}
.dialog label:not(.checkbox-label),
.dialog .def-label {
	font-weight: 600;
	font-size: 1rem;
	background: var(--def-label-background);
	border-radius: 4px;
	padding: 4px 8px;
	min-height: 34px;
	display: flex;
	align-items: center;
	white-space: nowrap;
	overflow: hidden;
}
.dialog input[type="text"],
.dialog input[type="date"],
.dialog input[type="number"],
.dialog select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--line-soft);
	border-radius: 6px;
	font-size: 1rem;
}
.dialog select {
	background: var(--surface-white);
}
.dialog .field-display {
	display: block;
	padding: 8px 10px;
	min-height: 38px;
	font-size: 1rem;
	line-height: 1.5;
}

/* 監査表示は3タブ共通。セレクタを集約して差分混入を防ぐ */
#info-audit,
#estimate-audit,
#invoice-audit {
	margin-top: 12px;
	border-top: 1px solid var(--line-mid);
	padding-top: 8px;
	grid-column: 1 / 3;
	width: 100%;
}
#info-audit .audit-row,
#estimate-audit .audit-row,
#invoice-audit .audit-row {
	display: flex;
	gap: 12px;
	padding: 2px 0;
}
#info-audit .audit-label,
#estimate-audit .audit-label,
#invoice-audit .audit-label {
	min-width: var(--dialog-label-width);
	color: #555;
	font-weight: 600;
}
#info-audit .audit-value,
#estimate-audit .audit-value,
#invoice-audit .audit-value {
	flex: 1;
	color: #222;
	min-width: 0;
	word-break: break-word;
}
/* 請求タブのラベル幅を他タブと合わせる */
.invoice-price-row {
	display: flex;
	align-items: center;
	gap: 8px;
	grid-column: 1 / -1;
}
.invoice-price-row .def-label {
	flex: 0 0 var(--dialog-label-width);
	max-width: var(--dialog-label-width);
}
.invoice-price-row .field-display {
	flex: 1;
	min-width: 0;
	display: inline-block;
	padding: 0;
	border: none;
	background: transparent;
}
.invoice-price-row .def-label-input {
	max-width: var(--dialog-label-width);
	width: var(--dialog-label-width);
}
.tab-panel[data-tab="invoice"] .def-label-input {
	max-width: var(--dialog-label-width);
	width: var(--dialog-label-width);
}
.checkbox-label.checkbox-narrow {
	min-width: 32px;
	display: inline-flex;
	justify-content: center;
}
.dialog footer {
	padding: 12px 16px 14px;
	border-top: 1px solid var(--line-light);
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	position: sticky;
	bottom: 0;
	background: #fff;
	z-index: 3;
}

/* タブ/メッセージ表示 */
.tab-wrap {
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #fff;
	padding-top: 0;
	padding-bottom: 8px;
}
.dialog-message {
	min-height: 2rem;
	padding: 4px 8px;
	border: 1px solid var(--line-soft);
	border-radius: 4px;
	background: var(--surface-white);
	font-size: 0.9rem;
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tab-list {
	display: flex;
	gap: 6px;
	padding: 4px 0 0;
	margin: 0;
}
.tab-button {
	border: 1px solid var(--line-soft);
	background: #f8f9fb;
	padding: 8px 12px;
	border-radius: 8px 8px 0 0;
	font-weight: 700;
	cursor: pointer;
	color: #333;
}
.tab-button:hover {
	border-bottom: none;
}
.tab-button.is-active {
	background: var(--surface-tab-active);
	border-bottom-color: var(--surface-tab-active);
	color: #1f6b43;
	box-shadow: 0 -1px 6px rgba(0,0,0,0.05);
}
.tab-button.is-disabled,
.tab-button[aria-disabled="true"] {
	cursor: not-allowed;
	pointer-events: none;
	color: #9aa0a8;
	background: #f1f3f6;
	border-color: #e1e4ea;
	box-shadow: none;
}
.tab-panels {
	border: 1px solid var(--line-soft);
	border-radius: 10px;
	padding: 12px 12px 2px;
	background: var(--surface-white);
	min-height: 0;
	max-height: none;
}
.tab-panel {
	display: grid;
	/* 左: ラベル固定幅(120px), 右: 入力エリア可変 */
	grid-template-columns: var(--dialog-label-width) 1fr;
	column-gap: 12px;
	row-gap: 10px;
	min-height: 0;
}

/* 請求書タブ用の行整列 */
.invoice-row {
	grid-column: 1 / 3;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
}
.invoice-row label {
	margin: 0;
	min-width: 72px;
}
.invoice-row select {
	flex: 1 1 160px;
}
.invoice-row input[type="text"] {
	flex: 1 1 140px;
}
.invoice-row .checkbox-label {
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	font-weight: 400;
	min-width: 26px;
	padding: 0 2px;
}
.invoice-row input[type="checkbox"] {
	cursor: pointer;
}
.price00-divider-row {
	/* PRICE00 行の区切りを目立たせる（二重線） */
	border-bottom: 3px double #7d7d7d;
	padding-bottom: 6px;
	margin-bottom: 2px;
}

.tab-panel:not(.is-active) { display: none; }
