/* Socious Translator - shared styles. Vanilla CSS, custom properties on :root. */
:root {
  --bg: #0e1116; --bg2: #171c24; --fg: #f2f4f7; --muted: #a3acb9; --line: #2a3240;
  --accent: #5cc8ff; --accent-fg: #04202e; --ok: #4ade80; --warn: #fbbf24; --bad: #ff7b7b;
  --fs: 22px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg2: #f1f4f8; --fg: #12161c; --muted: #4b5563; --line: #d3d9e2;
  --accent: #0a62a8; --accent-fg: #ffffff; --ok: #15803d; --warn: #92400e; --bad: #b42323;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.5;
  word-break: normal; overflow-wrap: anywhere; line-break: strict;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .btn {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  min-height: 40px; cursor: pointer; color: var(--fg); text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button[disabled] { opacity: .5; cursor: not-allowed; }
button[aria-pressed="true"], button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
input[type=text], input[type=password], select, textarea {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-height: 40px;
}
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.live { background: var(--ok); } .dot.paused { background: var(--warn); } .dot.down { background: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .dot.live { animation: pulse 2s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .45; } }

/* Viewer */
.v-wrap { display: flex; flex-direction: column; height: 100dvh; max-width: 900px; margin: 0 auto; }
.v-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.v-title { font-weight: 600; flex: 1 1 100%; order: -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.v-bar button { min-height: 40px; min-width: 40px; padding: 4px 10px; }
.v-bar { justify-content: flex-end; }
@media (min-width: 560px) { .v-title { flex: 1 1 140px; order: 0; } }
.v-list { flex: 1; overflow-y: auto; padding: 12px 14px 20px; font-size: var(--fs); line-height: 1.55; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.seg { margin: 0 0 .8em; }
.seg .alt { font-size: .72em; color: var(--muted); margin-top: .15em; }
.seg .pending { color: var(--muted); }
.seg .tag { font-size: .6em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 6px; vertical-align: middle; }
.v-interim { padding: 8px 14px 14px; font-size: var(--fs); color: var(--muted); min-height: 1.6em; border-top: 1px dashed var(--line); }
.live-btn { position: fixed; right: 14px; bottom: 76px; z-index: 5; background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.empty { color: var(--muted); text-align: center; margin-top: 3em; font-size: .8em; }

/* Pages */
.page { max-width: 760px; margin: 0 auto; padding: 16px; }
.page.wide { max-width: 1000px; }
h1 { font-size: 1.5rem; margin: .4em 0; } h2 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
.card { display: flex; align-items: center; gap: 12px; padding: 18px; margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); color: var(--fg); text-decoration: none; min-height: 64px; }
.card:hover { border-color: var(--accent); }
.card .t { font-size: 1.15rem; font-weight: 600; flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; } .row > .grow { flex: 1 1 160px; }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: var(--bg2); }
.banner { padding: 10px 14px; border-radius: 10px; margin: 10px 0; border: 1px solid var(--warn); color: var(--warn); background: var(--bg2); }
.banner.err { border-color: var(--bad); color: var(--bad); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; background: var(--bg2); }
.vu { height: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.vu > i { display: block; height: 100%; width: 0; background: var(--ok); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; }
table.grid td { padding: 3px 3px 3px 0; vertical-align: top; }
table.grid td input { min-height: 36px; }
.fin { border-bottom: 1px solid var(--line); padding: 8px 0; }
.fin .tr { color: var(--accent); }
.qr { background: #fff; padding: 10px; display: inline-block; border-radius: 8px; line-height: 0; }
.qr svg, .qr img { width: 200px; height: 200px; }
.rooms { display: flex; flex-direction: column; gap: 4px; }
.rooms button { text-align: left; justify-content: flex-start; }
footer { margin: 30px 0 10px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
