:root {
  --cream-bg: #FBF3E7;
  --cream-card: #FFFAF0;
  --cream-deep: #F5E9D3;
  --terracotta: #C9663F;
  --terracotta-light: #E07A57;
  --terracotta-dark: #A04C2A;
  --text-dark: #3B2A1F;
  --text-mid: #6B5547;
  --text-light: #8B7568;
  --border: #E8D9C0;
  --shadow: 0 2px 12px rgba(180,120,80,0.08);
  --shadow-hover: 0 4px 20px rgba(180,120,80,0.16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--cream-bg);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
  padding-top: 54px;
}

/* ===== ヘッダー帯（Swipee / どこにげ 同型） ===== */
.mn-topband {
  position: fixed; top: 0; left: 0; right: 0; height: 54px; z-index: 300;
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: var(--cream-card); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(70, 45, 25, 0.05);
}
.mn-topband-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 0; margin-right: auto; }
.mn-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.mn-brand:hover { text-decoration: none; }
.mn-brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.mn-brand-name { font-size: 16px; font-weight: 800; letter-spacing: 0.02em; color: var(--terracotta-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-brand-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; color: var(--text-light); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-topnav { display: flex; align-items: center; gap: 2px; margin-right: 6px; min-width: 0; overflow-x: auto; }
.mn-navlink {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--text-mid); text-decoration: none; white-space: nowrap;
  transition: background .14s, color .14s;
}
.mn-navlink:hover { background: var(--cream-deep); color: var(--terracotta-dark); text-decoration: none; }
.mn-navlink.active { background: var(--terracotta); color: #fff; }
.mn-nav-ico { display: inline-flex; width: 16px; height: 16px; color: var(--terracotta); flex-shrink: 0; }
.mn-nav-ico svg { width: 16px; height: 16px; }
.mn-navlink:hover .mn-nav-ico { color: var(--terracotta-dark); }
.mn-navlink.active .mn-nav-ico { color: #fff; }
.mn-topband-right { display: flex; align-items: center; flex-shrink: 0; }
.mn-sidebar-topnav { display: none; }

.sidebar {
  width: 240px; min-width: 240px;
  background: var(--cream-card);
  border-right: 1px solid var(--border);
  position: fixed; top: 54px; left: 0; height: calc(100vh - 54px);
  overflow-y: auto; padding: 16px 0; z-index: 100;
}
.nav-group-label { font-size: 10px; font-weight: 700; color: var(--text-light); letter-spacing: 0.08em; text-transform: uppercase; padding: 12px 20px 4px; }
.nav-item { display: flex; justify-content: space-between; align-items: center; padding: 9px 20px; font-size: 13px; color: var(--text-mid); cursor: pointer; transition: all 0.15s; border-left: 3px solid transparent; user-select: none; text-decoration: none; font-weight: 400; }
.nav-item:hover { background: var(--cream-deep); color: var(--text-dark); text-decoration: none; }
.nav-item.active { background: var(--terracotta); color: #fff; border-left: 3px solid var(--terracotta-dark); font-weight: 600; }
.nav-item.active .nav-count { background: rgba(255,255,255,0.25); color: #fff; }
.nav-count { background: var(--cream-deep); color: var(--text-light); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 8px; min-width: 24px; text-align: center; }
.main { margin-left: 240px; flex: 1; padding: 40px 48px; max-width: 980px; }
.page-eyebrow { font-size: 11px; color: var(--text-light); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.page-header h1 { font-size: 26px; font-weight: 800; color: var(--terracotta-dark); margin-bottom: 6px; line-height: 1.4; }
.page-meta { font-size: 12px; color: var(--text-light); margin-bottom: 28px; }
.count-badge { display: inline-block; background: var(--terracotta); color: #fff; font-weight: 700; padding: 2px 12px; border-radius: 999px; font-size: 13px; margin-left: 8px; }
section { margin-bottom: 40px; scroll-margin-top: 80px; }
section h2 { font-size: 18px; font-weight: 700; color: var(--terracotta-dark); border-bottom: 2px solid var(--cream-deep); padding-bottom: 8px; margin-bottom: 16px; }
h3, h4, h5 { font-size: 14px; font-weight: 700; color: var(--text-dark); margin: 18px 0 8px; }
h4 { font-size: 13px; color: var(--terracotta-dark); }
h5 { font-size: 13px; color: var(--text-mid); font-weight: 600; }
.card { background: var(--cream-card); border-radius: 12px; padding: 22px 24px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
ul.styled-list { list-style: none; padding: 0; margin-bottom: 10px; }
ul.styled-list li { padding: 4px 0 4px 18px; position: relative; color: var(--text-dark); font-size: 14px; line-height: 1.7; }
ul.styled-list li::before { content: "\2022"; color: var(--terracotta); position: absolute; left: 0; font-weight: 700; }
ul.styled-list li.nested { margin-left: 18px; }
ul.styled-list li.nested::before { content: "\2013"; color: var(--terracotta-light); }
ul.action-list { list-style: none; padding: 0; margin-bottom: 10px; }
ul.action-list li { padding: 6px 0; display: flex; gap: 8px; align-items: baseline; font-size: 14px; border-bottom: 1px dashed var(--border); }
ul.action-list li:last-child { border-bottom: none; }
ul.action-list input[type="checkbox"] { accent-color: var(--terracotta); margin-top: 3px; flex-shrink: 0; }
.hook-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hook-table th { background: var(--cream-deep); color: var(--text-mid); font-weight: 600; padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border); }
.hook-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-dark); vertical-align: top; }
.hook-table tr:last-child td { border-bottom: none; }
.hook-table tbody tr:hover td { background: var(--cream-deep); }
.hook-table td.num { color: var(--text-light); text-align: right; width: 52px; white-space: nowrap; }
.monthly-table tbody tr { cursor: pointer; }
.meta-table th { width: 90px; white-space: nowrap; background: transparent; border-bottom: 1px solid var(--border); color: var(--text-light); }
.meta-table tr:last-child th { border-bottom: none; }
.quote-block { border-left: 4px solid var(--terracotta-light); padding: 12px 18px; background: var(--cream-deep); border-radius: 0 8px 8px 0; color: var(--text-mid); margin: 12px 0; font-size: 13px; line-height: 1.8; }
p { margin-bottom: 10px; font-size: 14px; color: var(--text-dark); }
p.muted, .muted { color: var(--text-light); font-size: 13px; }
a { color: var(--terracotta-dark); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
code { background: var(--cream-deep); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 0.88em; font-family: "SFMono-Regular", Menlo, Consolas, monospace; color: var(--terracotta-dark); }

/* badges */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-right: 4px; white-space: nowrap; }
.badge-kanbu { background: #C9663F; color: #fff; }
.badge-chukan { background: #8B6F47; color: #fff; }
.badge-eigyo { background: #4E7A5A; color: #fff; }
.badge-funnel { background: #5B6C9E; color: #fff; }
.badge-kobetsu { background: #A8763E; color: #fff; }
.badge-person { background: var(--cream-deep); color: var(--text-mid); border: 1px solid var(--border); }
.badge-inbox { background: var(--text-light); color: #fff; }
.badge-warn { background: #FDF0E5; color: #B4552D; border: 1px solid #EAC9A8; }

/* index list */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
#searchBox { flex: 1; max-width: 380px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--cream-card); font-size: 13px; color: var(--text-dark); outline: none; }
#searchBox:focus { border-color: var(--terracotta-light); }
.clear-filter { border: 1px solid var(--border); background: var(--cream-card); color: var(--text-mid); font-size: 12px; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.clear-filter:hover { background: var(--cream-deep); }
.mt-row { display: block; background: var(--cream-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; box-shadow: var(--shadow); transition: box-shadow 0.15s, transform 0.15s; color: var(--text-dark); font-weight: 400; }
.mt-row:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); text-decoration: none; }
.mt-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mt-date { font-size: 12px; font-weight: 700; color: var(--text-light); font-variant-numeric: tabular-nums; }
.mt-title { font-size: 16px; font-weight: 700; color: var(--terracotta-dark); margin-bottom: 4px; }
.mt-snippet { font-size: 13px; color: var(--text-mid); margin-bottom: 6px; }
.mt-meta { font-size: 11px; color: var(--text-light); }
.mt-cell-title { font-weight: 600; color: var(--terracotta-dark); }
.empty-note { text-align: center; color: var(--text-light); padding: 40px 0; }

/* detail */
.breadcrumb { margin-bottom: 16px; font-size: 13px; }
.detail-actions { display: flex; align-items: center; gap: 14px; margin: 4px 0 28px; flex-wrap: wrap; }
.dl-btn { display: inline-block; background: var(--terracotta); color: #fff; font-size: 13px; font-weight: 700; padding: 9px 20px; border-radius: 8px; box-shadow: var(--shadow); }
.dl-btn:hover { background: var(--terracotta-dark); text-decoration: none; }
.dl-note { font-size: 12px; color: var(--text-light); }
.transcript-note { margin-top: 8px; }

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* account + bell（帯の右側にマウント・Swipee 同型） */
.mn-account { display: flex; align-items: center; gap: 6px; }
.mn-bell-wrap, .mn-user-wrap { position: relative; }
.mn-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--cream-card); color: var(--text-mid); cursor: pointer; transition: border-color .15s, color .15s, background .15s; box-shadow: var(--shadow); }
.mn-bell:hover { border-color: var(--terracotta); color: var(--terracotta-dark); background: var(--cream-deep); }
.mn-bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #C0392B; color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.mn-bell-badge[hidden] { display: none; }
.mn-user { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--cream-card); cursor: pointer; max-width: 260px; font-family: inherit; transition: border-color .15s, background .15s; box-shadow: var(--shadow); }
.mn-user:hover { border-color: var(--terracotta); background: var(--cream-deep); }
.mn-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%; background: var(--text-light); color: #fff; font-size: 13px; font-weight: 800; line-height: 1; overflow: hidden; }
.mn-avatar.is-admin { background: var(--terracotta); }
.mn-avatar.has-photo { background: none; }
.mn-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mn-user-name { font-size: 12px; font-weight: 700; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.mn-user-caret { color: var(--text-light); flex: 0 0 auto; }
.mn-bell-pop, .mn-user-pop { position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--cream-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-hover); padding: 12px 14px; }
.mn-bell-pop { min-width: 320px; max-width: min(92vw, 380px); padding: 0; overflow: hidden; }
.mn-bell-pop[hidden], .mn-user-pop[hidden] { display: none; }
.mn-pop-email { font-size: 12px; font-weight: 700; color: var(--text-dark); word-break: break-all; }
.mn-pop-role { font-size: 11.5px; color: var(--text-mid); margin: 4px 0 10px; }
.mn-logout { display: inline-block; font-size: 12px; font-weight: 700; color: var(--terracotta-dark); }
.mn-notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.mn-notif-head-title { font-size: 11.5px; font-weight: 800; color: var(--text-mid); letter-spacing: .04em; }
.mn-notif-read-all { border: 0; background: none; padding: 0; font-family: inherit; font-size: 11px; font-weight: 700; color: var(--terracotta-dark); cursor: pointer; }
.mn-notif-read-all:hover { text-decoration: underline; }
.mn-notif-read-all[hidden] { display: none; }
.mn-notif-list { max-height: min(60vh, 420px); overflow: auto; padding: 8px 10px 10px; }
.mn-notif-empty { font-size: 12.5px; color: var(--text-light); padding: 16px 6px; text-align: center; }
.mn-notif-item { display: flex; gap: 10px; padding: 10px 8px; border-radius: 10px; text-decoration: none; color: inherit; transition: background .12s; font-weight: 400; }
.mn-notif-item:hover { background: var(--cream-deep); text-decoration: none; }
.mn-notif-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; }
.mn-notif-item.is-unread .mn-notif-dot { background: var(--terracotta); }
.mn-notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mn-notif-kind { display: inline-block; align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; }
.mn-notif-kind.is-new { color: #2F6B34; background: rgba(79, 138, 82, 0.14); }
.mn-notif-title { font-size: 12.5px; font-weight: 700; color: var(--text-dark); line-height: 1.45; }
.mn-notif-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-light); }

@media (max-width: 900px) {
  .mn-topnav { display: none; }
  .mn-sidebar-topnav {
    display: flex; flex-direction: column; gap: 2px;
    padding: 0 0 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  }
  .mn-sidebar-topnav .mn-navlink { width: 100%; justify-content: flex-start; padding: 11px 18px; border-radius: 0; border-left: 3px solid transparent; }
  .mn-sidebar-topnav .mn-navlink.active { border-left-color: var(--terracotta); background: var(--cream-deep); color: var(--terracotta-dark); }
  .mn-sidebar-topnav .mn-navlink.active .mn-nav-ico { color: var(--terracotta); }
}

@media (max-width: 768px) {
  body { display: block; padding-top: 54px; }
  .sidebar {
    position: static; width: 100%; height: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-y: visible; padding: 12px 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  }
  .mn-sidebar-topnav { display: flex; flex-direction: row; flex-wrap: wrap; width: 100%; padding: 0 12px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); gap: 4px; }
  .mn-sidebar-topnav .mn-navlink { width: auto; padding: 6px 12px; border-left: none; border-radius: 9px; }
  .mn-sidebar-topnav .mn-navlink.active { border-left: none; background: var(--terracotta); color: #fff; }
  .mn-sidebar-topnav .mn-navlink.active .mn-nav-ico { color: #fff; }
  .nav-group-label { display: none; }
  .nav-item { padding: 6px 12px; font-size: 12px; border-left: none; border-bottom: 2px solid transparent; gap: 6px; }
  .nav-item.active { border-left: none; border-bottom: 2px solid var(--terracotta-dark); }
  .main { margin-left: 0; padding: 24px 20px; }
  .page-header h1 { font-size: 20px; }
  section h2 { font-size: 16px; }
  .card { padding: 16px 18px; }
  .hook-table { font-size: 12px; }
  .hook-table th, .hook-table td { padding: 7px 10px; }
}
@media (max-width: 600px) {
  .mn-topband { height: 52px; padding: 0 12px; }
  body { padding-top: 52px; }
  .mn-account { gap: 5px; }
  .mn-user { max-width: 150px; padding: 0 8px 0 5px; }
  .mn-user-name { max-width: 88px; font-size: 11px; }
  .mn-brand-name { font-size: 15px; }
}
@media (max-width: 480px) {
  .main { padding: 16px 14px; }
  .page-header h1 { font-size: 18px; }
  .mn-brand-tag { display: none; }
}
