/* 静的サイト版の部品スタイル。
   元アプリは Gradio の部品（行・列・ブロック・スライダー・ドロップダウン・ラジオ・数値欄・折りたたみ・ボタン）の上に
   app.py の CSS を重ねている。ここでは Gradio 6.31 の各部品の CSS（Apache-2.0）と同じ値を、
   静的 HTML 用のクラス名（gr-slider など）に付け替えて書いている。app.py の CSS（css/app_a.css, app_b.css）は
   このファイルの後に読み込み、そのまま上書きさせる。 */

html, body { background: #0b1c1d; }
body { margin: 0; display: flex; flex-direction: column; min-height: 100vh; font-family: Arial, Helvetica, sans-serif; color: #27272a; }
gradio-app { display: flex; flex-direction: column; flex: 1 1 auto; background: #fff; }
.gradio-container { min-height: 1px; color: var(--body-text-color); flex-direction: column; padding: 0; display: flex; position: relative; overflow: hidden; flex: 1 1 auto; }
.main { flex-direction: column; flex-grow: 1; display: flex; }
.app { width: 100%; height: 100%; margin: auto; position: relative; }
.main > .wrap { width: 100%; font-weight: var(--body-text-weight); font-size: var(--body-text-size); flex-direction: column; flex-grow: 1; display: flex; min-height: 100%; }
main.contain { flex-direction: column; display: flex; flex: 1 1 auto; }

/* レイアウト（gr.Row / gr.Column / フォームのまとまり / ブロック） */
.column { gap: var(--layout-gap); flex-direction: column; display: flex; position: relative; }
.column > *, .column > .form > * { width: 100%; }
.row { gap: var(--layout-gap); width: 100%; flex-wrap: wrap; display: flex; position: relative; }
.row > *, .row > .form > * { flex-wrap: wrap; flex: 1; min-width: min(160px, 100%); }
.unequal-height { align-items: flex-start; }
.form { flex-direction: inherit; gap: var(--form-gap-width); box-shadow: var(--block-shadow); border: var(--block-border-width) solid var(--block-border-color); border-radius: var(--block-radius); background: var(--border-color-primary); flex-wrap: wrap; display: flex; overflow-y: hidden; }
.form .block { box-shadow: none !important; border-width: 0 !important; border-radius: 0 !important; }
.block { box-shadow: var(--block-shadow); border-width: var(--block-border-width); border-color: var(--block-border-color); border-radius: var(--block-radius); background: var(--block-background-fill); width: 100%; line-height: var(--line-sm); margin: 0; position: relative; }
.auto-margin { margin-left: auto; margin-right: auto; }
.block.padded { padding: var(--block-padding); }      /* fieldset 等の初期化（gradio-base）より優先させる */
.hide-container { box-shadow: none; background: 0 0; border-width: 0; margin: 0; padding: 0; overflow: visible; }
.html-container { padding: var(--block-padding); }
.hidden, .hide { display: none !important; }
.sr-only { clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; width: 1px; height: 1px; margin: -1px; padding: 0; position: absolute; overflow: hidden; }

/* 部品の見出し（BlockTitle） */
.gr-title { display: inline-block; position: relative; z-index: var(--layer-4); border: solid var(--block-title-border-width) var(--block-title-border-color); border-radius: var(--block-title-radius); background: var(--block-title-background-fill); padding: var(--block-title-padding); color: var(--block-title-text-color); font-weight: var(--block-title-text-weight); font-size: var(--block-title-text-size); line-height: var(--line-sm); }
.gr-title:not(.has-info) { margin-bottom: var(--spacing-lg); }
.gr-title.has-info { margin-bottom: var(--spacing-xs); }
.info-text { font-weight: var(--block-info-text-weight); font-size: var(--block-info-text-size); line-height: var(--line-sm); color: var(--block-info-text-color); margin-bottom: var(--spacing-md); }

/* ボタン */
button.gr-button { transition: var(--button-transition); padding: var(--size-0-5) var(--size-2); text-align: center; justify-content: center; align-items: center; display: inline-flex; cursor: pointer; font-family: inherit; }
button.gr-button.lg { border-radius: var(--button-large-radius); padding: var(--button-large-padding); font-weight: var(--button-large-text-weight); font-size: var(--button-large-text-size); }
button.gr-button.secondary { border: var(--button-border-width) solid var(--button-secondary-border-color); background: var(--button-secondary-background-fill); color: var(--button-secondary-text-color); box-shadow: var(--button-secondary-shadow); }
button.gr-button.secondary:hover { background: var(--button-secondary-background-fill-hover); border-color: var(--button-secondary-border-color-hover); }
button.gr-button.primary { border: var(--button-border-width) solid var(--button-primary-border-color); background: var(--button-primary-background-fill); color: var(--button-primary-text-color); box-shadow: var(--button-primary-shadow); }
button.gr-button.primary:hover { background: var(--button-primary-background-fill-hover); border-color: var(--button-primary-border-color-hover); }

/* 1行の文字入力（gr.Textbox） */
.gr-textbox label { width: 100%; display: block; }
.gr-textbox .input-container { align-items: flex-end; display: flex; position: relative; }
.gr-textbox input[type=text] { resize: none; z-index: 1; background: var(--input-background-fill); padding: var(--input-padding); width: 100%; color: var(--body-text-color); font-weight: var(--input-text-weight); font-size: var(--input-text-size); line-height: var(--line-sm); border: none; flex-grow: 1; margin-top: 0; font-family: inherit; }
.gr-textbox label.show_textbox_border input { box-shadow: var(--input-shadow); }
.gr-textbox label:not(.container), .gr-textbox label:not(.container) input { height: 100%; }      /* Gradio: container=False の欄は高さを親に合わせる */
.gr-textbox input::placeholder { color: var(--input-placeholder-color); }
.gr-textbox input:focus { outline: none; }

/* スライダー（gr.Slider: 見出し + 数値欄 + リセット + つまみ） */
.gr-slider .wrap { flex-direction: column; width: 100%; display: flex; }
.gr-slider .head { margin-bottom: var(--size-2); flex-wrap: wrap; justify-content: space-between; align-items: flex-start; width: 100%; display: flex; }
.gr-slider .head > label { flex: 1; }
.gr-slider .head > .tab-like-container { order: 1; margin-left: auto; }
.gr-slider .tab-like-container { border: 1px solid var(--input-border-color); border-radius: var(--radius-sm); height: var(--size-6); align-items: stretch; display: flex; overflow: hidden; }
.gr-slider .tab-like-container input[type=number] { padding: var(--size-1) var(--size-2); height: 100%; min-width: var(--size-14); font-size: var(--text-sm); border: none; border-radius: 0; background: var(--input-background-fill); color: var(--body-text-color); line-height: var(--line-sm); text-align: center; outline: none; font-family: inherit; }
.gr-slider .tab-like-container input[type=number]:focus { box-shadow: inset 0 0 0 1px var(--color-accent); border-radius: 3px 0 0 3px; }
.gr-slider .reset-button { border: none; border-left: 1px solid var(--input-border-color); cursor: pointer; font-size: var(--text-sm); color: var(--body-text-color); padding: 0 var(--size-2); min-width: var(--size-6); background: 0 0; justify-content: center; align-items: center; transition: background-color .15s ease-in-out; display: flex; }
.gr-slider .reset-button:hover { background-color: var(--background-fill-secondary); }
.gr-slider .slider_input_container { align-items: center; gap: var(--size-2); display: flex; }
.gr-slider input[type=range] { appearance: none; -webkit-appearance: none; cursor: pointer; border-radius: var(--radius-xl); width: 100%; min-width: var(--size-28); background: 0 0; outline: none; margin: 0; }
.gr-slider input[type=range]::-webkit-slider-runnable-track { height: var(--size-2); border-radius: var(--radius-xl); background: linear-gradient(to right, var(--slider-color) var(--range_progress), var(--neutral-200) var(--range_progress)); }
.gr-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; height: var(--size-4); width: var(--size-4); background-color: #fff; border-radius: 50%; margin-top: -5px; box-shadow: 0 0 0 1px #f7f6f6bc, 1px 1px 4px #0000001a; }
.gr-slider input[type=range]::-moz-range-track { height: var(--size-2); background: var(--neutral-200); border-radius: var(--radius-xl); }
.gr-slider input[type=range]::-moz-range-progress { height: var(--size-2); background-color: var(--slider-color); border-radius: var(--radius-xl); }
.gr-slider input[type=range]::-moz-range-thumb { height: var(--size-4); width: var(--size-4); background-color: #fff; border: none; border-radius: 50%; box-shadow: 0 0 0 1px #f7f6f6bc, 1px 1px 4px #0000001a; }
.gr-slider .min_value, .gr-slider .max_value { font-size: var(--text-sm); color: var(--body-text-color-subdued); }
.gr-slider .min_value { margin-right: var(--size-0-5); }
.gr-slider .max_value { margin-left: var(--size-0-5); margin-right: var(--size-0-5); }
@media (width <= 480px) { .gr-slider .min_value, .gr-slider .max_value { display: none; } }
@media (width <= 520px) { .gr-slider .head { gap: var(--size-3); } }
@media (width <= 420px) { .gr-slider .head .tab-like-container { margin-bottom: var(--size-4); } }

/* ドロップダウン（gr.Dropdown の見た目を、ふつうの select で再現） */
.gr-dropdown .container { height: 100%; display: block; }
.gr-dropdown .wrap { border-radius: var(--input-radius); background: var(--input-background-fill); position: relative; box-shadow: var(--input-shadow); border: var(--input-border-width) solid var(--border-color-primary); }
.gr-dropdown .wrap:focus-within { box-shadow: var(--input-shadow-focus); border-color: var(--input-border-color-focus); background: var(--input-background-fill-focus); }
.gr-dropdown .wrap-inner { align-items: center; gap: var(--checkbox-label-gap); padding: var(--checkbox-label-padding); flex-wrap: wrap; height: 100%; display: flex; position: relative; }
.gr-dropdown .secondary-wrap { border: none; flex: 1; align-items: center; min-width: min-content; height: 100%; display: flex; }
.gr-dropdown select { appearance: none; -webkit-appearance: none; margin: var(--spacing-sm); background: inherit; width: var(--size-full); color: var(--body-text-color); font-size: var(--input-text-size); border: none; outline: none; height: 100%; cursor: pointer; font-family: inherit; line-height: 17px; padding: 0 28px 0 0; height: 17px; }   /* 元の input と文字の縦位置を揃える */
.gr-dropdown .icon-wrap { top: 50%; right: var(--size-5); color: var(--body-text-color); width: var(--size-5); pointer-events: none; position: absolute; transform: translateY(-50%); display: flex; }
.gr-dropdown .dropdown-arrow { fill: currentColor; }

/* ラジオ（gr.Radio） */
.gr-radio { border: 0; min-width: 0; }
.gr-radio .wrap { gap: var(--checkbox-label-gap); flex-wrap: wrap; display: flex; }
.gr-radio label { display: flex; align-items: center; transition: var(--button-transition); cursor: pointer; box-shadow: var(--checkbox-label-shadow); border: var(--checkbox-label-border-width) solid var(--checkbox-label-border-color); border-radius: var(--checkbox-border-radius); background: var(--checkbox-label-background-fill); padding: var(--checkbox-label-padding); color: var(--checkbox-label-text-color); font-weight: var(--checkbox-label-text-weight); font-size: var(--checkbox-label-text-size); line-height: var(--line-md); }
.gr-radio label:hover { background: var(--checkbox-label-background-fill-hover); }
.gr-radio label.selected { background: var(--checkbox-label-background-fill-selected); color: var(--checkbox-label-text-color-selected); border-color: var(--checkbox-label-border-color-selected); }
.gr-radio label > * + * { margin-left: var(--size-2); }
.gr-radio input[type=radio] { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 16px; height: 16px; box-shadow: var(--checkbox-shadow); border: var(--checkbox-border-width) solid var(--checkbox-border-color); border-radius: var(--radius-full); background-color: var(--checkbox-background-color); line-height: var(--line-sm); position: relative; cursor: pointer; }
.gr-radio input[type=radio]:checked { border-color: var(--checkbox-border-color-selected); background-image: var(--radio-circle); background-color: var(--checkbox-background-color-selected); }

/* 数値欄（gr.Number） */
.gr-number label.container { display: block; }
.gr-number input[type=number] { border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); box-shadow: var(--input-shadow); background: var(--input-background-fill); padding: var(--input-padding); width: 100%; color: var(--body-text-color); font-size: var(--input-text-size); line-height: var(--line-sm); display: block; position: relative; outline: none !important; font-family: inherit; }
.gr-number input[type=number]:focus { box-shadow: var(--input-shadow-focus); border-color: var(--input-border-color-focus); background: var(--input-background-fill-focus); }

/* 折りたたみ（gr.Accordion） */
.gr-accordion .label-wrap { cursor: pointer; width: var(--size-full); color: var(--accordion-text-color); justify-content: space-between; display: flex; background: none; border: 0; font: inherit; }
.gr-accordion .label-wrap.open { margin-bottom: var(--size-2); }
.gr-accordion .label-wrap span { font-weight: var(--section-header-text-weight); font-size: var(--section-header-text-size); }
.gr-accordion .icon { transition: all .15s; }

/* 一時的なお知らせ（未実装の画面に移るとき） */
.tj-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2000; background: #0b1c1d; color: #fff; border: 1px solid #c7a15a; padding: 12px 18px; font: 14px/1.6 "Noto Sans JP", sans-serif; letter-spacing: .04em; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: min(560px, 92vw); }
