/* 話者用画面 */
:root { --bg: #f1f5f9; --panel: #fff; --line: #e2e8f0; --text: #0f172a; --muted: #64748b; }
body { background: var(--bg); color: var(--text); font-family: "Noto Sans JP", "Noto Sans", sans-serif; font-size: 15px; line-height: 1.6; min-height: 100vh; }
a { color: var(--c-accent); }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 60px; background: #0b1324; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--c-accent-2); color: #1f2937; padding: 2px 7px; border-radius: 5px; }
.logo { width: 22px; height: 22px; border-radius: 6px; background: conic-gradient(from 200deg, #38bdf8, #a3e635, #fbbf24, #f472b6, #c084fc, #38bdf8); }
.tabs { display: flex; gap: 4px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; padding: 0 14px; color: #cbd5e1; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a.on { color: #fff; border-bottom-color: var(--c-accent-2); font-weight: 700; }
#openDisplay { margin-left: auto; white-space: nowrap; }
.notice { margin: 0; padding: 8px 20px; background: #fff7e6; color: #7c4a03; font-size: 12.5px; border-bottom: 1px solid #fde3b0; }

main { max-width: 1440px; margin: 0 auto; padding: 18px 20px 60px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel + .panel { margin-top: 16px; }
h2 { font-size: 19px; margin: 0 0 8px; }
.lead { color: #334155; margin: 0 0 14px; }
.lead-list { margin: 4px 0 16px; padding-left: 1.2em; color: #334155; }
.lead-list li { margin-bottom: 6px; }
.warn-li { color: #7c2d12; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cbd5e1; background: #fff; color: var(--text); padding: 9px 15px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: #94a3b8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.btn-primary:hover { background: #0b6971; }
.btn-dark { background: #1e293b; border-color: #334155; color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

/* ライブ翻訳 */
.live { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.ctrl { position: sticky; top: 76px; }
.mic { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 20px; border-radius: 14px; border: 0; cursor: pointer; font-size: 20px; font-weight: 700; color: #fff; background: var(--c-accent); box-shadow: 0 6px 18px rgba(14,124,134,.28); transition: .2s; }
.mic:hover { filter: brightness(1.05); }
.mic.on { background: #dc2626; box-shadow: 0 0 0 0 rgba(220,38,38,.5); animation: micpulse 1.6s infinite; }
.mic:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); } 70% { box-shadow: 0 0 0 14px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.mstat { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 10px; }
.mstat.on { color: #dc2626; font-weight: 700; }
.interim-box { min-height: 84px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 10px 12px; font-size: 16px; color: #64748b; background: #f8fafc; }
.interim-box .ph { font-size: 13px; color: #94a3b8; }
.interim-box .live-t::after { content: "▍"; color: var(--c-accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.field { margin-top: 14px; }
.field-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #eef2f7; font-size: 13px; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--lc); }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13.5px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { flex: none; width: 40px; height: 22px; border-radius: 999px; background: #cbd5e1; position: relative; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--c-accent); }
.switch input:checked + span::after { left: 21px; }
.switch input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.typeform { display: flex; gap: 6px; margin-top: 14px; }
.typeform input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; }

.log-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.log-head b { font-size: 16px; white-space: nowrap; }
.log-head .btn { margin-left: auto; }
.empty-log { color: var(--muted); text-align: center; padding: 50px 10px; }
.entry { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; animation: fadein .35s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } }
.entry .jah { display: flex; gap: 10px; align-items: baseline; }
.entry time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.entry .ja { font-size: 17px; font-weight: 700; margin: 0; }
.entry .fix { font-size: 12px; color: #92400e; margin: 2px 0 0 0; }
.entry .bkall { margin-left: auto; flex: none; }
.trs { width: 100%; border-collapse: collapse; margin-top: 8px; }
.trs th { width: 128px; text-align: left; vertical-align: top; font-size: 12.5px; color: #475569; font-weight: 600; padding: 7px 8px 7px 0; border-top: 1px solid #f1f5f9; }
.trs th i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lc); margin-right: 6px; }
.trs td { padding: 7px 0; border-top: 1px solid #f1f5f9; vertical-align: top; }
.trs .t { margin: 0; font-size: 15.5px; }
.trs .ms { color: #94a3b8; font-size: 11px; margin-left: 6px; font-family: "Noto Sans", sans-serif; }
.trs .back { margin: 3px 0 0; font-size: 13px; color: #475569; background: #f8fafc; border-left: 3px solid #cbd5e1; padding: 2px 8px; }
.trs .back::before { content: "↩ 逆翻訳："; color: #94a3b8; }
.trs .q { color: #b45309; font-size: 12px; }
.pending { display: inline-flex; gap: 4px; }
.pending b { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: dot 1.2s infinite; }
.pending b:nth-child(2) { animation-delay: .2s; } .pending b:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.errt { color: #b91c1c; font-size: 13px; }

/* 原稿モード */
.lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
textarea { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 10px; resize: vertical; line-height: 1.7; font-size: 15px; }
#scriptTitle { padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; min-width: 220px; }
.saved { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.saved .sv { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 4px 12px; background: #f8fafc; font-size: 13px; }
.saved .sv button { border: 0; background: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: var(--c-accent); font-weight: 600; }
.saved .sv button.del { color: #94a3b8; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.player { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.player select { padding: 8px; border-radius: 9px; border: 1px solid #cbd5e1; }
.review { margin-top: 12px; overflow-x: auto; }
.rv { width: 100%; border-collapse: collapse; min-width: 760px; }
.rv th { position: sticky; top: 0; background: #f8fafc; text-align: left; font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--line); }
.rv td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.rv td.n { color: var(--muted); width: 32px; font-variant-numeric: tabular-nums; }
.rv td.jac { font-weight: 600; min-width: 200px; }
.rv tr { cursor: pointer; }
.rv tr:hover td { background: #f8fafc; }
.rv tr.sel td { background: #ecfeff; }
.rv tr.done td.n::after { content: " ✓"; color: var(--c-ok); }
.rv .back { margin: 4px 0 0; font-size: 12.5px; color: #475569; }
.rv .back::before { content: "↩ "; color: #94a3b8; }

/* 用語辞書 */
.gl-wrap { overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; }
.gl { border-collapse: collapse; width: 100%; min-width: 900px; }
.gl th { background: #f8fafc; font-size: 12.5px; text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gl td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.gl input { width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 14px; }
.gl input:hover { border-color: #e2e8f0; }
.gl input:focus { border-color: var(--c-accent); background: #fff; outline: none; }
.gl td.jat input { font-weight: 700; }
.gl .st { display: inline-block; margin: 2px 0 0 8px; font-size: 11px; border-radius: 999px; padding: 1px 8px; cursor: pointer; border: 1px solid #fdba74; color: #9a3412; background: #fff7ed; user-select: none; }
.gl .st.ok { border-color: #86efac; color: #166534; background: #f0fdf4; }
.gl .del { border: 0; background: none; color: #94a3b8; cursor: pointer; font-size: 16px; }
.gl td.trc { min-width: 170px; }

/* 表示言語 */
.langgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.lg { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; transition: .15s; }
.lg:hover { border-color: #94a3b8; }
.lg .nat { font-size: 17px; font-weight: 700; }
.lg .jn { font-size: 12.5px; color: var(--muted); }
.lg.on { border-color: var(--c-accent); background: #f0fdfa; }
.lg .no { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--c-accent); color: #fff; font-size: 13px; font-weight: 700; display: none; align-items: center; justify-content: center; }
.lg.on .no { display: flex; }
.lg .badge-weak { align-self: flex-start; margin-top: 4px; }

@media (max-width: 980px) {
  .live { grid-template-columns: 1fr; }
  .ctrl { position: static; }
}
@media (max-width: 640px) {
  .top { gap: 10px; padding: 0 12px; height: auto; flex-wrap: wrap; padding-top: 8px; }
  .brand { font-size: 15px; }
  #openDisplay { padding: 6px 10px; font-size: 12.5px; }
  .tabs { order: 3; width: 100%; height: 42px; }
  .tabs a { padding: 0 10px; font-size: 13px; }
  main { padding: 12px 12px 50px; }
  .panel { padding: 14px; }
  .trs th { width: 84px; }
  #scriptTitle { min-width: 0; flex: 1; }
}
