/* EC Digital brand tokens. --brand is the slate grey of the EC Digital logo. */
:root {
  --brand: #444c53;
  --brand-ink: #ffffff;
  --bg: #ffffff;
  --panel: #f7f7f8;
  --line: #e6e6ea;
  --ink: #18181b;
  --muted: #6b6b76;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 12px; }
button:hover { background: var(--panel); }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); }
textarea { resize: vertical; min-height: 90px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Header */
.top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--ink); }
.logo img { width: 26px; height: 26px; display: block; }
.top .grow { flex: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; }

/* Share page layout */
.wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 1400px; margin: 0 auto; padding: 20px; }
.wrap.with-side { grid-template-columns: minmax(0, 1fr) 360px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; }

.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .15); cursor: pointer; }
.play { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
.play::after { content: ""; border-left: 26px solid var(--brand); border-top: 16px solid transparent; border-bottom: 16px solid transparent; margin-left: 6px; }
.speed { position: absolute; left: 16px; bottom: 16px; background: rgba(0, 0, 0, .7); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.speed:hover { background: rgba(0, 0, 0, .85); }
.float-emoji { position: absolute; bottom: 20px; font-size: 34px; pointer-events: none; animation: rise 1.6s ease-out forwards; }
@keyframes rise { to { transform: translateY(-220px); opacity: 0; } }

.bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 22px; }
.bar .emo { font-size: 20px; padding: 4px 10px; border-radius: 999px; }
.bar .sep { flex: 1; }

.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.summary { white-space: pre-wrap; }
.links a { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; text-decoration: none; font-weight: 600; }

/* Sidebar */
.side { border: 1px solid var(--line); border-radius: var(--radius); align-self: start; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; border-radius: 0; padding: 12px 6px; background: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }
.pane { padding: 16px; display: grid; gap: 12px; max-height: 70vh; overflow: auto; }
.pane label { font-size: 13px; font-weight: 600; display: grid; gap: 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.comment { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.comment b { margin-right: 6px; }
.stat { font-size: 28px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.line { cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.line:hover { background: var(--panel); }
.line.now { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.bar button.on { border-color: var(--brand); color: var(--brand); font-weight: 700; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }

/* Dashboard */
.dash { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.dash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.dash-head h1 { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tile .thumb { position: relative; aspect-ratio: 16 / 9; background: #111 center / cover no-repeat; display: block; }
.tile .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.tile .body { padding: 10px 12px; display: grid; gap: 4px; }
.tile .title { font-weight: 600; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .actions { display: flex; gap: 6px; padding: 0 12px 12px; flex-wrap: wrap; }
.tile .actions button { padding: 4px 9px; font-size: 13px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; z-index: 10; }

/* Recorder */
select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); font: inherit; }
.rec { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; max-width: 1400px; margin: 0 auto; padding: 20px; }
.rec-side { display: grid; gap: 14px; align-self: start; }
.rec-side label { font-size: 13px; font-weight: 600; display: grid; gap: 4px; }
.rec-side .row button { flex: 1; }
.rec-side .row button.on { border-color: var(--brand); color: var(--brand); font-weight: 700; }
button.big { padding: 12px; font-size: 16px; }
.small { font-size: 13px; margin: 0; }
.stage { position: relative; background: #111; border-radius: var(--radius); overflow: hidden; }
.stage canvas { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: contain; }
.count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .45); }
.controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.controls .grow { flex: 1; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #dc2626; animation: blink 1s infinite; }
.paused .rec-dot { animation: none; background: var(--muted); }
@keyframes blink { 50% { opacity: .3; } }
#processing { margin-top: 12px; }

@media (max-width: 900px) {
  .wrap.with-side, .cols, .rec { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 16px; }
  .top { padding: 10px 16px; }
}
