/* たしかにプラス株式会社 デザインシステム準拠
   （sr-ai client/src/app/globals.css と同じトークン。色を変えるときは両方を揃える） */
:root {
  --brand: #D70027;
  --brand-light: #DD2647;
  --brand-dark: #B70021;

  --bg: #F9FAFB;
  --card: #FFFFFF;
  --surface: #F9FAFB;
  --text: #333333;
  --muted: #6B7280;
  --border: #333333;          /* 輪郭線は濃いグレー。薄い罫線は --hairline */
  --hairline: #E5E7EB;
  --divider: #474747;

  /* 自分=ブランド赤 / 相手=濃いグレー で話者を区別する */
  --self: #D70027;
  --remote: #474747;
  --danger: #B70021;
  --ok: #474747;

  --radius: 16px;             /* カード */
  --radius-pill: 50px;        /* ボタン */
  --radius-input: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
    system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.04em; line-height: 1.3; }

a { color: var(--brand); }

.site-header {
  padding: 1rem 1.25rem;
  background: var(--card);
  border-top: 4px solid var(--brand);
  border-bottom: 1px solid var(--hairline);
}
.site-header h1 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; }
.site-header h1::before {
  content: "";
  width: 10px; height: 22px;
  background: var(--brand);
  border-radius: 2px;
  flex: none;
}
.site-header h1 a { text-decoration: none; color: var(--text); }
.site-header h1 a:hover { color: var(--brand); }
.tagline { margin: .25rem 0 0; color: var(--muted); font-size: .85rem; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.card h2, .card h3 { margin-top: 0; }
.card h2 { font-size: 1.05rem; }
.card h3 { font-size: .98rem; }

.form-grid { display: grid; gap: .75rem; }
.form-grid label { display: grid; gap: .25rem; font-size: .9rem; }
input[type=text], input[type=email], input[type=search], input[type=date] {
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
}
input:focus { outline: 2px solid var(--brand); outline-offset: 2px; }

button {
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: .5rem 1.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all .25s ease;
}
button:hover { background: var(--surface); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.primary {
  background: var(--brand);
  border: 2px solid var(--border);
  color: #fff;
}
button.primary:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); }
button.danger {
  background: var(--divider);
  border: 2px solid var(--border);
  color: #fff;
}
button.danger:hover:not(:disabled) { background: #333; transform: translateY(-1px); }

.hint, .muted { color: var(--muted); font-size: .85rem; }
.link { font-size: .85rem; }

.notice {
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--divider);
  border-radius: 10px;
  background: var(--surface);
  padding: .7rem .9rem;
  margin-bottom: .75rem;
  font-size: .9rem;
}
.notice p { margin: .2rem 0; }
.notice.warn { border-left-color: var(--brand-light); }
.notice.error { border-left-color: var(--brand); background: #FDF2F4; }
.notice.info { border-left-color: var(--muted); }

.meeting-list { display: grid; gap: .5rem; }
.meeting-item {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: .65rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: all .2s ease;
}
.meeting-item:hover { border-color: var(--brand); background: #FDF2F4; }
.meeting-item .title { font-weight: 700; }
.meeting-item .sub { color: var(--muted); font-size: .8rem; }

.meeting-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.meeting-status { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }

.badge {
  display: inline-block;
  padding: .1rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--muted);
}
.badge.recording { background: var(--brand); border-color: var(--brand); color: #fff; }
.badge.done { background: #fff; border-color: var(--border); color: var(--text); }
.badge.processing { background: var(--surface); border-color: var(--divider); color: var(--divider); }

.guide { font-size: .9rem; padding-left: 1.2rem; }
.guide li { margin: .15rem 0; }
.controls { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: .85rem 0; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 700; }

.meters { display: grid; gap: .35rem; max-width: 420px; }
.meter-row { display: flex; align-items: center; gap: .5rem; }
.meter-label { font-size: .8rem; width: 3em; font-weight: 700; }
.meter-label.self { color: var(--self); }
.meter-label.remote { color: var(--remote); }
.meter { flex: 1; height: 8px; background: #E9EBEF; border-radius: 999px; overflow: hidden; }
.meter-bar { height: 100%; width: 0%; background: var(--self); transition: width .1s linear; }
#meter-remote { background: var(--remote); }

.timeline-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.toggle { font-size: .85rem; color: var(--muted); }

.timeline { display: grid; gap: .5rem; max-height: 65vh; overflow-y: auto; }
.seg {
  border-left: 4px solid var(--hairline);
  padding: .4rem .7rem;
  border-radius: 0 12px 12px 0;
  background: var(--surface);
}
.seg.self { border-left-color: var(--self); background: #FDF2F4; }
.seg.remote { border-left-color: var(--remote); background: var(--surface); }
.seg-head { display: flex; gap: .5rem; align-items: baseline; font-size: .78rem; color: var(--muted); }
.seg-speaker { font-weight: 700; }
.seg.self .seg-speaker { color: var(--self); }
.seg.remote .seg-speaker { color: var(--remote); }
.seg-text { margin: .15rem 0 0; white-space: pre-wrap; word-break: break-word; }
.seg-translation {
  margin: .25rem 0 0;
  padding-left: .6rem;
  border-left: 2px dotted var(--brand);
  color: var(--brand-dark);
  white-space: pre-wrap;
}
.seg-translation::before { content: "訳文: "; font-size: .78rem; color: var(--muted); }
.seg-pending { color: var(--muted); font-style: italic; }

@media (max-width: 600px) {
  .container { padding: .75rem .75rem 3rem; }
  .meeting-status { align-items: flex-start; }
  .timeline { max-height: none; }
}

/* ---- 話者名の編集 ---- */
.seg-speaker.editable { cursor: pointer; border-bottom: 1px dashed currentColor; }
.seg-speaker.editable:hover { opacity: .75; }

/* ---- 議事録ページ ---- */
.controls.wrap { flex-wrap: wrap; gap: .75rem 1rem; align-items: center; }
.tabs { display: flex; gap: .35rem; }
.tab {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: .25rem 1rem; font-size: .85rem; font-weight: 700; cursor: pointer; color: var(--muted);
}
.tab:hover { background: var(--surface); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.preview {
  width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; margin-top: .75rem;
}

@media (max-width: 600px) {
  .preview { height: 60vh; }
  .tabs { width: 100%; }
}

/* ---- ヘッダーのログイン状態 ---- */
.header-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.session-area { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.session-name { font-weight: 700; }
.session-drive { color: var(--muted); font-size: .78rem; }
.link-button {
  background: none; border: none; padding: 0; color: var(--brand);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline;
}
.link-button:hover { background: none; color: var(--brand-dark); }

/* ---- 検索フォーム ---- */
.search-grid { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.search-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; }
.search-grid label.grow { flex: 1 1 260px; }
.search-grid input { padding: .45rem .7rem; border: 1px solid var(--border); border-radius: 10px; }
.date-range { display: flex; align-items: center; gap: .35rem; }
.search-actions { display: flex; gap: .5rem; }

/* ---- 共有・ドライブ ---- */
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.manage-grid h4 { margin: 0 0 .5rem; font-size: .9rem; }
.share-list { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .85rem; }
.share-list li {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .35rem 0; border-bottom: 1px solid var(--hairline);
}

@media (max-width: 700px) {
  .manage-grid { grid-template-columns: 1fr; }
  .header-row { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .search-grid label.grow { flex-basis: 100%; }
}

/* ---- ヘッダーの導線（使い方ボタン） ---- */
.header-tools { display: flex; align-items: center; gap: 1rem; }
.btn-link {
  display: inline-block;
  padding: .3rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
  white-space: nowrap;
  transition: all .25s ease;
}
.btn-link:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- 使い方ページ ---- */
.guide-page .card h2 { font-size: 1.1rem; padding-bottom: .4rem; border-bottom: 2px solid var(--border); }
.guide-page .card h2.warn-head { color: var(--brand); border-bottom-color: var(--brand); }
.guide-page .guide { padding-left: 1.3rem; }
.guide-page .guide > li { margin: .5rem 0; }
.guide-page .guide ul { margin: .3rem 0; padding-left: 1.1rem; }
.plain-list { margin: .5rem 0; padding-left: 1.2rem; }
.plain-list li { margin: .45rem 0; }
.tag {
  display: inline-block; padding: 0 .5rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; border: 1px solid currentColor;
}
.tag.self { color: var(--self); }
.tag.remote { color: var(--remote); }
.faq { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .3rem; }
.faq th, .faq td { border: 1px solid var(--hairline); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.faq th { background: var(--surface); font-weight: 700; white-space: nowrap; }
.faq tr td:first-child { white-space: nowrap; font-weight: 700; }

@media (max-width: 600px) {
  .header-tools { gap: .6rem; }
  .faq tr td:first-child { white-space: normal; }
  .faq th { white-space: normal; }
}
