:root {
  --brand: #4f46e5;
  --brand-d: #3f37c9;
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e3e6ef;
  --text: #1f2430;
  --muted: #6b7280;
  --danger: #dc3545;
  --ok: #16a34a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", "Microsoft JhengHei", Roboto, sans-serif;
  line-height: 1.55; padding-bottom: env(safe-area-inset-bottom);
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 14px; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .wrap { display: flex; align-items: center; gap: 8px; height: 54px; }
.brand { font-weight: 700; }
.spacer { flex: 1; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin: 14px 0; box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
h2 { font-size: 1.05rem; margin: 0 0 12px; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--text);
}
textarea { resize: vertical; }
.minutes { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92rem; line-height: 1.6; }

.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 10px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.block { display: block; width: 100%; }
.btn.big { padding: 15px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.recording { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(220,53,69,.5)} 70%{box-shadow:0 0 0 14px rgba(220,53,69,0)} 100%{box-shadow:0 0 0 0 rgba(220,53,69,0)} }

.row { display: flex; align-items: center; gap: 10px; }
.wrap-row { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 700; }
.hidden { display: none !important; }

.dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: #f4f3ff; }
.dropzone .big { font-size: 2rem; }
.or { text-align: center; color: var(--muted); font-size: .9rem; margin: 8px 0; }

.status {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: #eef2ff; border: 1px solid #dfe3ff; font-size: .95rem;
}
.status.err { background: #fff0f1; border-color: #ffd6da; color: #b3232f; white-space: pre-wrap; }
.status .spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--brand); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.adv { margin-top: 6px; }
.adv summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.adv[open] { padding-top: 8px; }
.footer { text-align: center; margin: 18px 0 30px; }
