[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Yu Gothic", "Meiryo", sans-serif; color: #1f2933; background: #f3f5f7; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 20px; min-height: 52px; background: #1f3a5f; color: #fff; }
header h1 { margin: 0; font-size: 20px; }
header .sub { font-size: 13px; opacity: 0.85; }
main { display: grid; grid-template-columns: 380px 1fr; gap: 16px; padding: 16px; height: calc(100% - 52px); }
section { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 16px; overflow: auto; }

#drop { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed #8aa1bd; border-radius: 8px; padding: 28px 12px; cursor: pointer; background: #f8fbff; font-size: 14px; }
#drop.over { background: #e3efff; border-color: #2b6cb0; }
#drop span { font-size: 12px; color: #52606d; }
#drop input { display: none; }
#options { margin: 12px 0; font-size: 13px; }
#options label { display: block; margin: 6px 0; }
#options input[type=number] { width: 90px; margin-left: 6px; }

#job { margin-top: 12px; font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
#job-name { font-weight: bold; word-break: break-all; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.badge.warn { background: #c53030; color: #fff; }
.status { font-weight: bold; }
.status.done { color: #276749; } .status.done_partial { color: #b7791f; } .status.needs_review { color: #c05621; } .status.error { color: #c53030; }
.muted { color: #52606d; font-size: 12px; }
#status-msg { margin: 8px 0; font-size: 13px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
button, .button { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid #2b6cb0; border-radius: 4px; background: #fff; color: #2b6cb0; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #ebf4ff; }
#review { border: 1px solid #f6ad55; background: #fffaf0; border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
#warnings { font-size: 12px; padding-left: 18px; }
.error { margin-top: 12px; padding: 8px 12px; border-radius: 6px; background: #fff5f5; color: #c53030; font-size: 13px; white-space: pre-wrap; }

#right { display: flex; flex-direction: column; }
#tabs { display: flex; gap: 4px; margin-bottom: 8px; }
#tabs button.on { background: #2b6cb0; color: #fff; }
#panes { flex: 1; position: relative; min-height: 400px; }
.pane { display: none; position: absolute; inset: 0; }
.pane.on { display: block; }
.pane img, .pane video { max-width: 100%; max-height: 100%; display: block; margin: 0 auto; }
.pane iframe { width: 100%; height: 100%; border: 0; border-radius: 6px; }
.placeholder { color: #9aa5b1; text-align: center; margin-top: 80px; }

/* 試作版の表示・アカウント・使い方・対象フロア・履歴 */
header .trial { font-size: 12px; font-weight: bold; padding: 2px 8px; border-radius: 4px; background: #f6ad55; color: #1f2933; }
header #account { margin-left: auto; font-size: 13px; }
header #account a { color: #fff; margin-left: 8px; }
#guide { font-size: 13px; background: #f8fbff; border: 1px solid #c3d4e8; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
#guide p { margin: 0 0 4px; }
#guide ul { margin: 0; padding-left: 18px; }
#floor-row { display: block; font-size: 13px; margin-bottom: 8px; }
#floor-row select { margin-left: 8px; font: inherit; padding: 2px 4px; }
#history { margin-top: 16px; font-size: 13px; }
#history h3 { font-size: 14px; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
#history h3 button { font-size: 12px; padding: 2px 8px; }
#history table { width: 100%; border-collapse: collapse; }
#history th, #history td { text-align: left; padding: 4px; border-bottom: 1px solid #e4e7eb; font-size: 12px; word-break: break-all; }
#history th { color: #52606d; font-weight: normal; }

/* ログイン画面 */
body.login main.login-main { display: flex; justify-content: center; align-items: flex-start; padding-top: 64px; height: auto; }
.login-box { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 24px; width: 360px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.login-box h2 { margin: 0; font-size: 18px; }
.login-box p { margin: 0; }
.login-box input { font: inherit; padding: 8px; border: 1px solid #9aa5b1; border-radius: 4px; }
.login-box button { padding: 8px 12px; background: #2b6cb0; color: #fff; }
.login-box button:hover { background: #2c5282; }

/* ロゴ: 紺のヘッダでは白い角丸タイルに入れる(ログイン画面の白地ではタイルなし・40px) */
.logo-tile { display: inline-flex; padding: 2px; border-radius: 8px; background: #fff; flex: none; }
.logo-tile img { display: block; width: 28px; height: 28px; border-radius: 6px; }
.login-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: bold; color: #1f3a5f; }
.login-brand img { width: 40px; height: 40px; border-radius: 8px; }

/* 家具・中止・ボタンの状態 */
#furniture-row { display: block; font-size: 13px; margin-bottom: 8px; }
.badge.info { background: #ebf4ff; color: #2b6cb0; border: 1px solid #90b4e0; font-weight: normal; }
button.textlink { border: 0; background: none; padding: 0; margin-left: auto; color: #52606d; text-decoration: underline; text-underline-offset: 3px; }
button.textlink:hover { background: none; color: #1f2933; }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: #2b6cb0; color: #fff; }
button.primary:hover { background: #2c5282; }

/* ---------- 進捗カード(案 C2 の構成。色は現行のトーン) ---------- */
.p-card { border: 1px solid #c3d4e8; border-radius: 8px; padding: 8px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.p-time { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.p-time .num { font-size: 20px; font-weight: bold; }
.p-el { display: inline-flex; align-items: baseline; gap: 6px; font-weight: bold; white-space: nowrap; }
.p-el .live { align-self: center; width: 8px; height: 8px; border-radius: 50%; background: #2b6cb0; animation: mt-pulse 1s ease-in-out infinite; }
.p-mid { font-size: 12px; color: #52606d; text-align: center; }
.p-rest { justify-self: end; font-weight: bold; color: #2b6cb0; white-space: nowrap; }
.p-rest.ok { color: #276749; display: inline-flex; align-items: center; gap: 6px; }
.p-rest.ok .mark { width: 20px; height: 20px; border-radius: 50%; background: #38a169; color: #fff; display: grid; place-items: center; font-size: 12px; }
.p-rest.late { color: #c05621; }
.p-rest.stopped { color: #b7791f; }
.p-bar { position: relative; height: 12px; margin: 4px 0; border-radius: 999px; background: #e4e7eb; }
.p-bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(120deg, #63b3ed, #2b6cb0); transition: width .6s ease; }
.p-bar .fill.ok { background: #38a169; }
.p-bar .fill.stopped { background: #d69e2e; }
.p-bar .fill.over { animation: mt-glow 1.4s ease-in-out infinite; }
.p-bar .marker { position: absolute; right: -8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid #2b6cb0;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.45), 0 0 12px 2px #63b3ed; animation: mt-glow 1.4s ease-in-out infinite; }
.p-stages { list-style: none; padding: 0; margin: 4px 0 0; }
.p-stages li { display: grid; grid-template-columns: 22px 1fr auto; column-gap: 8px; align-items: center; padding: 2px 6px; border-radius: 6px; font-size: 13px; line-height: 1.4; }
.p-stages li + li { margin-top: 1px; }
.p-stages .t { font-weight: bold; }
.p-stages .s { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: bold; }
.p-stages .s small { font-weight: normal; color: #52606d; margin-right: 4px; }
.p-stages .d { grid-column: 2 / 4; font-size: 12px; color: #52606d; word-break: break-all; }
.p-stages .ok, .p-stages .ng { width: 18px; height: 18px; border-radius: 50%; background: #38a169; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: bold; }
.p-stages .ng { background: #c53030; }
.p-stages .todo { width: 16px; height: 16px; margin-left: 1px; border-radius: 50%; border: 2px solid #cbd2d9; background: #f5f7fa; }
.p-stages li.wait .t, .p-stages li.wait .s { color: #7b8794; font-weight: normal; }
.p-stages li.failed .s { color: #c53030; }
.p-stages li.run { background: #ebf4ff; padding-top: 4px; padding-bottom: 4px; }
.p-stages li.run .s { color: #2b6cb0; }
.p-stages li.run.over .s { color: #c05621; white-space: normal; text-align: right; font-size: 12px; }
.p-stages .mini { grid-column: 2 / 4; height: 5px; margin: 3px 0 1px; border-radius: 999px; background: #fff; overflow: hidden; }
.p-stages .mini span { display: block; height: 100%; width: 0; border-radius: inherit; background: #2b6cb0; transition: width .6s ease; }
.p-why { margin: 2px 0 0; font-size: 12px; color: #52606d; }
.spin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #c3d4e8; border-top-color: #2b6cb0; border-right-color: #2b6cb0; animation: mt-spin 1s linear infinite; }

/* タブ: まだできていないものは破線+「まだ」 */
#tabs button small.notyet-mark { display: none; font-size: 11px; margin-left: 4px; }
#tabs button.notyet { border-style: dashed; }
#tabs button.notyet small.notyet-mark { display: inline; }
#tabs button.notyet:not(.on) { color: #7b8794; border-color: #9aa5b1; }

/* 右ペイン: 処理中のプレースホルダ(一言+スケルトン) */
.wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; background: #f8fbff; border-radius: 6px; }
.w-msg { display: flex; align-items: center; gap: 12px; }
.w-msg .spin { width: 26px; height: 26px; border-width: 4px; flex: none; }
.w-msg strong { display: block; font-size: 16px; }
.w-msg span { display: block; font-size: 13px; color: #52606d; }
.skel { width: min(520px, 90%); height: 300px; display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1.4fr; grid-template-rows: 1.2fr 1fr .7fr; }
.skel i { border-radius: 10px; background: #e4e7eb; background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%);
  background-size: 200% 100%; background-position: 150% 0; animation: mt-shimmer 1.6s ease-in-out infinite; }
.skel i:nth-child(1) { grid-row: 1 / 3; }
.skel i:nth-child(4) { grid-column: 2 / 4; }
.skel i:nth-child(5) { grid-column: 1 / 4; }

/* 実写風動画タブ */
.pane.pr { overflow: auto; }
.pr-box { max-width: 960px; margin: 0 auto; padding: 8px 4px; font-size: 14px; }
.pr-lead { font-size: 16px; font-weight: bold; margin: 8px 0; }
.pr-check { display: block; margin: 8px 0; }
.pr-est { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 12px; }
.pr-est dt { color: #52606d; }
.pr-est dd { margin: 0; font-weight: bold; word-break: break-all; }
.ibar { position: relative; height: 8px; margin: 16px 0; border-radius: 999px; background: #e4e7eb; overflow: hidden; }
.ibar span { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(120deg, #63b3ed, #2b6cb0); animation: mt-pulse 1.6s ease-in-out infinite; }
.pr-players { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pr-players.compare { grid-template-columns: 1fr 1fr; }
.pr-players figure { margin: 0; }
.pr-players figcaption { font-size: 13px; color: #52606d; margin-bottom: 4px; }
.pr-players video { width: 100%; max-height: 70vh; display: block; background: #000; border-radius: 6px; }

@keyframes mt-spin { to { transform: rotate(360deg); } }
@keyframes mt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes mt-glow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes mt-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
