:root {
  --emerald-50: #effaf5;
  --emerald-100: #d9f3e7;
  --emerald-200: #b5e7d2;
  --emerald-300: #86d5b6;
  --emerald-500: #2fae82;
  --emerald-600: #22916c;
  --emerald-700: #1b7458;
  --white: #ffffff;
  --ink: #1f2d29;
  --ink-soft: #5b6b66;
  --line: #dcebe5;
  --danger: #e0565b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 70, 55, 0.06), 0 4px 16px rgba(20, 70, 55, 0.05);
  --font: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--emerald-50);
  min-width: 1100px; /* デスクトップ基準 */
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--emerald-300), var(--emerald-600));
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.support-note {
  font-size: 13px; color: #9a5b00; background: #fff6e5;
  border: 1px solid #f3d9a6; padding: 4px 10px; border-radius: 8px;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 20px 28px 28px;
  max-width: 1600px;
  margin: 0 auto;
  height: calc(100vh - 60px);
}
.main { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.sidebar, .summary-panel { min-height: 0; overflow-y: auto; }
.summary-panel { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.card-head-actions { display: flex; align-items: center; gap: 12px; }
h2 { font-size: 15px; margin: 0; font-weight: 700; }
h3 { font-size: 13px; margin: 0 0 6px; color: var(--emerald-700); font-weight: 700; }

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 12px;
}
.sidebar-title { font-size: 13px; color: var(--ink-soft); padding: 0 8px 8px; }
.session-list { list-style: none; margin: 0; padding: 0; }
.session-list li {
  padding: 10px 10px; border-radius: 8px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 6px;
}
.session-list li:hover { background: var(--emerald-50); }
.session-list li.active { background: var(--emerald-100); }
.session-list .s-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-list .s-date { font-size: 12px; color: var(--ink-soft); }
.session-list .s-del {
  border: none; background: none; color: var(--ink-soft); cursor: pointer;
  visibility: hidden; padding: 0 4px; font-size: 16px; line-height: 1;
}
.session-list li:hover .s-del { visibility: visible; }
.session-list .s-del:hover { color: var(--danger); }
#session-empty { padding: 0 8px; }

/* ---------- Meta ---------- */
.title-input {
  width: 100%; border: none; outline: none;
  font-size: 20px; font-weight: 700; padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
}
.title-input:focus { border-bottom-color: var(--emerald-500); }
.meta-row { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.field select, .field input {
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px;
  background: var(--white); color: var(--ink); font-size: 14px;
}
.field input { width: 120px; }
.field select:focus, .field input:focus { outline: 2px solid var(--emerald-200); border-color: var(--emerald-500); }
.meta-date { margin-left: auto; }

/* ---------- Recorder ---------- */
.recorder-card { display: flex; align-items: center; gap: 22px; }
.record-btn {
  width: 68px; height: 68px; border-radius: 50%;
  border: 3px solid var(--emerald-200); background: var(--white);
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  transition: border-color .15s, transform .1s;
}
.record-btn:hover { border-color: var(--emerald-500); }
.record-btn:active { transform: scale(0.96); }
.record-dot {
  width: 30px; height: 30px; border-radius: 50%; background: var(--danger);
  transition: border-radius .15s, width .15s, height .15s;
}
.record-btn.recording { border-color: var(--danger); animation: pulse 1.6s infinite; }
.record-btn.recording .record-dot { width: 24px; height: 24px; border-radius: 5px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 86, 91, 0.35); }
  70% { box-shadow: 0 0 0 14px rgba(224, 86, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 86, 91, 0); }
}
.recorder-info { min-width: 130px; }
.timer { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.status { font-size: 13px; color: var(--ink-soft); }
.status.live { color: var(--danger); font-weight: 600; }
.level { flex: 1; height: 56px; min-width: 120px; }
.recorder-actions { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--white);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 14px;
  transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: var(--emerald-50); border-color: var(--emerald-300); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--emerald-500); border-color: var(--emerald-500); color: var(--white); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--emerald-600); border-color: var(--emerald-600); }
.btn-ghost { border-color: var(--emerald-200); color: var(--emerald-700); }
.btn-small { padding: 4px 10px; font-size: 13px; }

/* ---------- Transcript ---------- */
.transcript-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.transcript {
  flex: 1; overflow-y: auto; padding: 4px 4px 4px 0; min-height: 160px;
}
.placeholder { color: var(--ink-soft); text-align: center; margin-top: 48px; font-size: 14px; }
.seg {
  display: grid; grid-template-columns: 72px 92px 1fr 24px; gap: 10px;
  padding: 8px 8px; border-radius: 8px; align-items: start;
}
.seg:hover { background: var(--emerald-50); }
.seg.marked { background: #fffbe8; }
.seg-time { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; padding-top: 3px; cursor: pointer; }
.seg-time:hover { color: var(--emerald-600); text-decoration: underline; }
.seg-speaker {
  font-size: 12px; font-weight: 600; color: var(--emerald-700);
  background: var(--emerald-100); border-radius: 6px; padding: 2px 8px;
  justify-self: start; margin-top: 2px; cursor: pointer;
  max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seg-text { outline: none; border-radius: 4px; }
.seg-text:focus { background: var(--white); box-shadow: 0 0 0 2px var(--emerald-200); }
.seg-mark {
  border: none; background: none; cursor: pointer; color: #ccd8d4; font-size: 15px; padding: 0;
}
.seg.marked .seg-mark { color: #e2a500; }
.interim { min-height: 28px; color: var(--ink-soft); font-style: italic; padding: 6px 8px 0; border-top: 1px dashed var(--line); margin-top: 6px; }
.interim:empty::before { content: " "; }
.player { width: 100%; margin-top: 10px; }

/* ---------- Summary ---------- */
.summary-section { margin-top: 16px; }
.sum-list { margin: 0; padding-left: 20px; font-size: 14px; }
.sum-list li { margin-bottom: 4px; }
.sum-list .muted { list-style: none; margin-left: -20px; }
.sum-list.todo { list-style: none; padding-left: 0; }
.sum-list.todo li label { display: flex; gap: 8px; align-items: flex-start; }
.sum-list.todo input { margin-top: 6px; accent-color: var(--emerald-500); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--emerald-100); color: var(--emerald-700); font-size: 12px; padding: 2px 10px; border-radius: 999px; }
textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; font-size: 14px;
}
textarea:focus { outline: 2px solid var(--emerald-200); border-color: var(--emerald-500); }
.export-card { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px; }
.export-card .btn { padding: 7px 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--white); padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.session-list .s-body { min-width: 0; }
.sidebar { display: flex; flex-direction: column; }
.privacy-note {
  margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-soft); line-height: 1.6;
}
.privacy-note strong { color: var(--emerald-700); }
.privacy-note p { margin: 4px 0 0; }
