﻿/* =========================================
   NOAH Family System - main.css
   Google Account-Style Light Theme
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --bg: #F0F2F5;
  --panel: #FFFFFF;
  --panel-2: #F7F8FA;
  --line: #DADDE1;
  --text: #1C1E21;
  --muted: #65676B;
  --accent: #1A73E8;
  --accent-hover: #1557b0;
  --success: #1E8E3E;
  --warn: #F9AB00;
  --danger: #D93025;
  --shadow: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Segoe UI", "Yu Gothic UI", sans-serif;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 笏笏 繝倥ャ繝繝ｼ 笏笏 */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.main-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-left {
  flex: 1;
  justify-content: flex-start;
}

.header-right {
  justify-content: flex-end;
  gap: 12px;
}

.header-center {
  justify-content: center;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.header-logo:hover,
.header-icon-btn:hover {
  text-decoration: none;
}

.header-logo svg {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--text);
}

.top-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #111827;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.top-nav-link:hover {
  text-decoration: none;
  background: #f2f6ff;
}

.top-nav-link.active {
  color: var(--accent);
  background: #eaf2ff;
  border-color: #d5e6ff;
}

.top-nav-dropdown-wrap {
  position: relative;
}

.top-nav-dropdown-toggle {
  font: inherit;
}

.top-nav-dropdown-caret {
  font-size: 12px;
  color: #6b7280;
}

.top-nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
  padding: 8px;
  z-index: 1260;
}

.top-nav-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 15px;
  color: #111827;
  text-decoration: none;
}

.top-nav-dropdown-item:hover {
  background: #f2f6ff;
  text-decoration: none;
}

.top-nav-dropdown-item.active {
  background: #eaf2ff;
  color: var(--accent);
}

.sidebar-toggle-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: #5f6b7a;
}

.sidebar-toggle-btn:hover {
  background: var(--bg);
  border-color: #cdd5df;
}

.sidebar-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.my-page-btn {
  gap: 8px;
  padding: 2px 4px 2px 2px;
  border: 1px solid transparent;
}

.my-page-btn:hover {
  background: var(--bg);
  border-color: var(--line);
}

.my-page-label {
  display: none;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
  background: var(--panel-2);
  flex: 0 0 40px;
}

.profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.profile-menu-toggle {
  background: transparent;
  cursor: pointer;
}
.profile-menu-caret {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.profile-menu-caret svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}
.profile-menu.open .profile-menu-caret svg {
  transform: rotate(180deg);
}
.profile-menu-dropdown {
  position: fixed;
  top: 68px;
  left: 10px;
  width: min(340px, calc(100vw - 20px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e4e7ec;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(10px);
  padding: 8px;
  z-index: 9800;
}
.profile-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 10px;
  color: #1f2430;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.profile-menu-item:hover {
  background: #f4f6f8;
}
.profile-menu-item-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.profile-menu-item-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-menu-item-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.profile-menu-divider {
  height: 1px;
  border-radius: 1px;
  background: #e8ebf0;
  margin: 6px 4px;
}

.online-members-strip {
  position: relative;
  display: none;
  align-items: center;
}

.online-members-strip.has-members {
  display: flex;
}

.online-members-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 999px;
}

.online-members-stack {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 2px 4px 2px 2px;
}

.online-member-stack-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.online-member-stack-avatar + .online-member-stack-avatar {
  margin-left: -10px;
}

.online-member-stack-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.online-members-extra {
  margin-left: 6px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.online-members-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  max-width: min(80vw, 360px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
  z-index: 1002;
}

.online-members-strip.expanded .online-member-stack-avatar + .online-member-stack-avatar {
  margin-left: 4px;
}

.online-member-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-radius: 8px;
  padding: 6px;
  color: var(--text);
}

.online-member-option:hover {
  background: var(--bg);
  text-decoration: none;
}

.online-member-option img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 30px;
  border: 1px solid var(--line);
}

.online-member-option-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 笏笏 繧ｷ繧ｧ繝ｫ 笏笏 */
.shell {
  display: block;
  min-height: calc(100vh - 60px);
  height: auto;
  overflow: visible;
}

.three-col-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100vh - 60px);
  padding: 0 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
}

.center-col,
.right-col {
  grid-column: 2;
}

.right-col {
  margin-top: 24px;
}

@media (max-width: 900px) {
  .shell,
  .three-col-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    padding: 0 16px;
  }
  .sidebar,
  .content {
    position: static;
    height: auto;
    overflow: visible;
  }
  .left-col,
  .center-col,
  .right-col {
    grid-column: 1;
    margin-top: 0;
  }
  .sidebar-toggle-btn {
    display: none;
  }
}

/* 笏笏 繧ｵ繧､繝峨ヰ繝ｼ 笏笏 */
.sidebar {
  display: none !important;
}

/* 邂｡逅・判髱｢縺ｯ蟾ｦ繧ｵ繧､繝峨ヰ繝ｼ陦ｨ遉ｺ繧呈怏蜉ｹ蛹・*/
body[data-page="systemDashboard"] .shell,
body[data-page="adminUsers"] .shell,
body[data-page="adminGroups"] .shell,
body[data-page="adminAnnouncements"] .shell,
body[data-page="adminCompliance"] .shell,
body[data-page="adminLogs"] .shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}

body[data-page="systemDashboard"] > header,
body[data-page="adminUsers"] > header,
body[data-page="adminGroups"] > header,
body[data-page="adminAnnouncements"] > header,
body[data-page="adminCompliance"] > header,
body[data-page="adminLogs"] > header {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 60px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body[data-page="systemDashboard"] > header::before,
body[data-page="adminUsers"] > header::before,
body[data-page="adminGroups"] > header::before,
body[data-page="adminAnnouncements"] > header::before,
body[data-page="adminCompliance"] > header::before,
body[data-page="adminLogs"] > header::before {
  content: "NOAH System Admin";
  margin-right: auto;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body[data-page="systemDashboard"] .sidebar,
body[data-page="adminUsers"] .sidebar,
body[data-page="adminGroups"] .sidebar,
body[data-page="adminAnnouncements"] .sidebar,
body[data-page="adminCompliance"] .sidebar,
body[data-page="adminLogs"] .sidebar {
  display: block !important;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 0 16px;
}

body[data-page="systemDashboard"] .content,
body[data-page="adminUsers"] .content,
body[data-page="adminGroups"] .content,
body[data-page="adminAnnouncements"] .content,
body[data-page="adminCompliance"] .content,
body[data-page="adminLogs"] .content {
  width: min(1180px, 100%);
  max-width: 1180px;
  margin: 0 auto;
  height: auto;
  overflow: visible;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
}

.brand {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
  padding: 0 16px;
}

/* Google 繧｢繧ｫ繧ｦ繝ｳ繝磯｢ｨ繝翫ン */
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 24px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  transition: background 0.2s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(26, 115, 232, 0.1);
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
}
.sidebar nav a .nav-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

/* 笏笏 繝√Ε繝・ヨ (WhatsApp鬚ｨ) 笏笏 */
.chat-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - 120px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-sidebar {
  width: 300px;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
}
.chat-sidebar h3 { padding: 20px; margin: 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #E5DDD5; /* WhatsApp鬚ｨ縺ｮ閭梧勹濶ｲ */
  position: relative;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-bubble-wrap {
  display: flex;
  margin-bottom: 4px;
  width: 100%;
}
.chat-bubble-wrap.mine { justify-content: flex-end; }
.chat-bubble {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
  line-height: 1.4;
}
.chat-bubble-wrap.mine .chat-bubble {
  background: #DCF8C6;
  border-top-right-radius: 0;
}
.chat-bubble-wrap:not(.mine) .chat-bubble {
  background: #FFFFFF;
  border-top-left-radius: 0;
}
.chat-bubble .meta {
  font-size: 11px;
  color: #999;
  text-align: right;
  margin-top: 4px;
}
.chat-input-area {
  padding: 12px 16px;
  background: #F0F0F0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.chat-input-area input {
  flex: 1;
  border-radius: 24px;
  border: none;
  padding: 10px 18px;
  background: white;
}

/* 笏笏 繧ｳ繝ｳ繝・Φ繝・笏笏 */
.content {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
body[data-page="chat"] .content {
  max-width: 1320px;
}
body[data-page="dashboard"] .content,
body[data-page="familyCulture"] .content,
body[data-page="index"] .content,
body[data-page="family"] .content,
body[data-page="noticeDetail"] .content,
body[data-page="albums"] .content,
body[data-page="albumDetail"] .content,
body[data-page="personalAlbum"] .content,
body[data-page="events"] .content,
body[data-page="eventDetail"] .content,
body[data-page="blog"] .content,
body[data-page="blogPost"] .content,
body[data-page="blogDetail"] .content {
  max-width: 1320px;
}

/* 笏笏 繧ｫ繝ｼ繝・笏笏 */
.hero,
.card,
.form-card,
.list-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.hero {
  display: grid;
  gap: 16px;
}

.family-charter-shell {
  display: grid;
  gap: 24px;
  position: static;
  overflow: visible;
  border-radius: 32px;
  padding: 34px 23px 38px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
  border: 0;
  box-shadow: 0 24px 54px rgba(21, 49, 94, 0.08);
}

.family-charter-shell-wrap {
  display: grid;
  gap: 14px;
}

.family-charter-frame-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 2px;
}

.family-charter-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 14px;
  background: #e9f2ff;
  color: #2a4f83;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-charter-edit-btn {
  min-width: 88px;
}

.family-charter-hero {
  display: grid;
  gap: 10px;
}

.family-charter-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.family-charter-eyebrow {
  margin: 0;
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.family-charter-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #0f172a;
}

.family-charter-article .family-charter-title {
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

.family-charter-article {
  padding: 32px;
}

.family-charter-header {
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.family-charter-tags {
  margin-bottom: 10px;
}

.family-charter-meta {
  gap: 14px;
}

.family-charter-author-avatar {
  width: 44px;
  height: 44px;
}

.family-charter-lead {
  margin: 0;
  max-width: 720px;
  color: #607089;
  font-size: 16px;
  line-height: 1.8;
}

.family-charter-body {
  display: grid;
  gap: 27px;
  font-size: 17px;
  line-height: 1.95;
  color: #24364f;
  margin-bottom: 40px;
}

.charter-intro {
  margin: 0;
  color: #24364f;
  font-size: 17px;
  line-height: 2;
}

.charter-section {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: grid;
  gap: 18px;
}

.charter-section h2 {
  margin: 0;
  color: #13223a;
  font-size: 24px;
  line-height: 1.4;
}

.charter-line {
  margin: 0;
  color: #24364f;
  font-size: 17px;
  line-height: 2;
}

.charter-line strong {
  color: #1f2d40;
}

.charter-quote {
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  color: #24364f;
  font-size: 17px;
  line-height: 2;
  font-weight: 600;
}

.family-charter-editor-screen {
  display: grid;
  gap: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.family-charter-editor-head {
  display: grid;
  gap: 0;
}

.family-charter-editor-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.family-charter-editor-eyebrow {
  margin: 0;
  color: #b45309;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.family-charter-editor-head h2 {
  margin: 24px 0 0;
  color: #0f172a;
  font-size: 34px;
  line-height: 1.5;
}

.family-charter-editor-head .muted {
  margin: 8px 0 0;
  color: #607089;
  font-size: 14px;
  line-height: 1.75;
}

.family-charter-editor-form {
  display: grid;
  gap: 18px;
}

.family-charter-editor-panel {
  display: grid;
  gap: 0;
  padding: 0;
  border-radius: 24px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.family-charter-editor-textarea {
  width: 100%;
  min-height: 560px;
  padding: 22px 24px;
  border: 1px solid #cdd8ea;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.98), rgba(244, 247, 251, 0.94));
  color: #18263c;
  font-size: 16px;
  line-height: 1.9;
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.12);
}

.family-charter-editor-actions {
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .family-charter-shell {
    gap: 18px;
    padding: 24px 12px 28px;
    border-radius: 26px;
  }
  .family-charter-shell-wrap {
    gap: 8px;
  }
  .family-charter-frame-tools {
    gap: 10px;
    padding: 0;
  }
  .family-charter-title {
    font-size: 20px;
  }
  .family-charter-article .family-charter-title {
    font-size: 22px;
    line-height: 1.45;
    margin-bottom: 12px;
  }
  .family-charter-article {
    padding: 22px 18px 18px;
    border-radius: 22px;
  }
  .family-charter-header {
    margin-bottom: 18px;
    padding-bottom: 18px;
  }
  .family-charter-tags {
    margin-bottom: 8px;
  }
  .family-charter-meta {
    gap: 10px;
  }
  .family-charter-author-avatar {
    width: 34px;
    height: 34px;
  }
  .family-charter-hero-top {
    align-items: flex-start;
  }
  .charter-section {
    padding: 0;
    border-radius: 0;
  }
  .charter-section h2 {
    font-size: 22px;
  }
  .charter-line,
  .charter-quote,
  .charter-intro {
    font-size: 17px;
    line-height: 1.95;
  }
  .family-charter-editor-screen {
    padding: 0;
    border-radius: 0;
    gap: 16px;
  }
  .family-charter-editor-head {
    gap: 0;
  }
  .family-charter-editor-head h2 {
    font-size: 26px;
  }
  .family-charter-editor-panel {
    padding: 0;
    border-radius: 0;
  }
  .family-charter-editor-textarea {
    min-height: 420px;
    padding: 18px;
    border-radius: 18px;
    font-size: 15px;
  }
  .family-charter-editor-actions {
    justify-content: stretch;
  }
  .family-charter-editor-actions .notice-mini-btn {
    flex: 1 1 0;
  }
}

/* 笏笏 繧ｰ繝ｪ繝・ラ 笏笏 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.stack { display: grid; gap: 16px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
h1, h2, h3 { margin: 0 0 12px; color: var(--text); }
p.muted, .muted { color: var(--muted); }

/* 笏笏 繝輔か繝ｼ繝蜈･蜉・笏笏 */
label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text); font-size: 14px; }
input, textarea, select {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}
textarea { min-height: 120px; resize: vertical; }

/* 笏笏 繝懊ち繝ｳ 笏笏 */
button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.1s;
}
button:hover { background: var(--accent-hover); }
button:active { transform: scale(0.98); }
button.secondary, a.secondary.button-like {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
button.secondary:hover, a.secondary.button-like:hover {
  background: var(--bg);
}
button.warn { background: var(--warn); color: #fff; }
button.danger { background: var(--danger); color: #fff; }
button.text-btn {
  background: transparent;
  border: none;
  padding: 4px;
  font-weight: normal;
  color: var(--accent);
  width: auto;
}
button.text-btn:hover { text-decoration: underline; background: transparent; }

.notice-detail-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.notice-detail-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notice-detail-titlebar h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.notice-detail-menu {
  position: relative;
  flex: 0 0 auto;
}

.notice-detail-menu-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}

.notice-detail-menu-toggle::-webkit-details-marker {
  display: none;
}

.notice-detail-menu-toggle::marker {
  content: "";
}

.notice-detail-menu[open] .notice-detail-menu-toggle {
  background: #f8fafc;
}

.notice-detail-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  display: grid;
  gap: 6px;
  min-width: 120px;
  padding: 8px;
  border: 1px solid #d8e2ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.notice-detail-menu-panel .notice-mini-btn {
  width: 100%;
  justify-self: stretch;
}

.notice-mini-btn {
  width: auto;
  min-width: 72px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
}

.notice-mini-btn:hover {
  transform: none;
}

.notice-mini-btn.notice-mini-btn-primary {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.notice-mini-btn.notice-mini-btn-primary:hover {
  background: #1557b0;
}

.notice-mini-btn.notice-mini-btn-soft {
  background: var(--panel-2);
}

.notice-mini-btn.notice-mini-btn-soft:hover {
  background: #eef1f5;
}

.notice-mini-link-btn {
  text-decoration: none;
}

.notice-mini-link-btn:hover {
  text-decoration: none;
}

.notice-mini-btn.notice-mini-btn-danger {
  border-color: #ef5350;
  background: #fff5f5;
  color: #c62828;
}

.notice-mini-btn.notice-mini-btn-danger:hover {
  background: #ffe7e7;
}

.notice-inline-image-wrap {
  margin: 4px 0 0;
}

.notice-inline-image-link {
  display: block;
  width: min(100%, 560px);
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #dbe5f1;
  box-shadow: 0 10px 24px rgba(38, 70, 113, 0.12);
}

.notice-inline-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  background: #eef3f9;
  transition: transform 0.24s ease, filter 0.24s ease;
}

.notice-inline-image-link:hover .notice-inline-image {
  transform: scale(1.02);
  filter: saturate(1.05);
}

.notice-inline-attachment {
  margin: 2px 0 0;
}

.notice-inline-attachment a {
  font-size: 13px;
  color: #2f5f9b;
  text-decoration: none;
  word-break: break-all;
}

.notice-inline-attachment a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .notice-inline-image {
    max-height: 240px;
  }
}

.notice-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.notice-edit-screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notice-edit-screen-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.35;
}

.notice-edit-attachment-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: #fbfdff;
}

.notice-edit-attachment-preview-image {
  display: block;
  width: min(100%, 280px);
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #dbe5f1;
}

.notice-edit-attachment-preview-file {
  margin: 0;
  color: #2f5f9b;
  word-break: break-all;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.family-invite-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}
#family-tree-member-create-dialog,
#family-tree-member-edit-dialog {
  z-index: 1300;
}

.family-invite-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.48);
}

.family-invite-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 0;
}
.family-tree-member-dialog__panel {
  width: min(760px, calc(100vw - 32px));
}

.family-invite-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 640px) {
  .family-invite-dialog {
    padding: 12px;
  }

  .family-invite-dialog__panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 20px);
  }

  .family-invite-dialog__header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 笏笏 繝舌ャ繧ｸ 笏笏 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(26, 115, 232, 0.1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}
.new-badge {
  display: inline-block;
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: top;
  margin-left: 6px;
}
.card.has-new {
  border-color: rgba(217, 48, 37, 0.4);
  box-shadow: 0 0 15px rgba(217, 48, 37, 0.1);
}

/* 笏笏 繝ｪ繧ｹ繝・笏笏 */
.list {
  display: grid;
  gap: 12px;
}
.list-item {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}
.event-sections {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.event-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-section-title {
  margin: 0;
  color: #2f4c6d;
  font-size: 24px;
  font-weight: 700;
}
.event-section-title-compact {
  font-size: 16px;
  letter-spacing: 0.02em;
}
.event-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.event-grid-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-color: #dce4ee;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.event-grid-card:hover,
.event-grid-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(32, 61, 94, 0.12);
  border-color: #7fa2ca;
}
.event-grid-link {
  color: inherit;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.event-grid-link:hover,
.event-grid-link:focus,
.event-grid-link:active,
.event-grid-link:visited {
  text-decoration: none !important;
}
.event-grid-media {
  margin: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  background: #e8edf3;
  aspect-ratio: 16 / 9;
}
.event-grid-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.event-grid-body {
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.event-tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf5ff;
  color: #2a73cf;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.event-grid-body > .event-tag-list {
  margin-bottom: 2px;
}
.event-detail-article > .event-tag-list {
  margin-bottom: 10px;
}
.event-grid-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: #243b59;
}
.event-grid-excerpt {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #62758e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: calc(1.45em * 2);
}
.event-grid-schedule {
  margin-top: 6px;
  font-size: 12px;
  color: #6f7783;
  line-height: 1.4;
}
.event-grid-hostline {
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.event-grid-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #e7edf5;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(38, 58, 86, 0.15);
}
.event-grid-host-name {
  font-size: 14px;
  color: #6a7079;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.event-grid-host-label {
  font-size: 13px;
  color: #7d8795;
}
.event-grid-participants {
  border-top: 1px solid #e3ebf5;
  padding: 8px 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fbfdff;
}
.event-grid-participant-stack {
  display: flex;
  align-items: center;
  padding-left: 2px;
}
.event-grid-participant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  background: #e7edf5;
  margin-left: -8px;
  box-shadow: 0 2px 8px rgba(38, 58, 86, 0.2);
}
.event-grid-participant-avatar:first-child {
  margin-left: 0;
}
.event-grid-participant-text {
  font-size: 12px;
  line-height: 1.3;
  color: #2b2f35;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-list-item {
  overflow: hidden;
  border: 1px solid #dce4ee;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.98));
  box-shadow: 0 10px 24px rgba(32, 61, 94, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.event-list-item:hover,
.event-list-item:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(32, 61, 94, 0.12);
  border-color: #c6d6ea;
}
.event-list-item.is-archived {
  border-style: dashed;
  background: linear-gradient(180deg, rgba(250, 251, 254, 0.96), rgba(244, 247, 252, 0.96));
}
.event-list-link {
  color: inherit;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}
.event-list-link:hover,
.event-list-link:focus,
.event-list-link:active,
.event-list-link:visited {
  text-decoration: none !important;
}
.event-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.event-list-row--top {
  align-items: flex-start;
}
.event-list-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 44px;
  box-shadow: 0 4px 12px rgba(32, 61, 94, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.9);
}
.event-list-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.event-list-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.event-list-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #243b59;
  font-weight: 800;
  flex: 1 1 auto;
  min-width: 0;
}
.event-list-date {
  font-size: 12px;
  line-height: 1.4;
  color: #718196;
}
.event-list-row--bottom {
  padding-left: 56px;
  justify-content: flex-start;
  gap: 10px;
}
.event-list-participant-stack {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  padding-left: 8px;
}
.event-list-participant-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  background: #e7edf5;
  margin-left: -8px;
  box-shadow: 0 2px 8px rgba(38, 58, 86, 0.2);
}
.event-list-participant-avatar:first-child {
  margin-left: 0;
}
.event-list-participant-text {
  font-size: 12px;
  line-height: 1.3;
  color: #2b2f35;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.event-grid-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.event-grid-actions .text-btn {
  font-size: 12px;
  text-decoration: none;
}
.event-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: var(--muted);
  background: var(--panel);
}
@media (max-width: 1500px) {
  .event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1280px) {
  .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .event-grid {
    grid-template-columns: 1fr;
  }
  .event-grid-host-name {
    font-size: 14px;
  }
  .event-grid-participant-text {
    font-size: 12px;
  }
}
.event-detail-page {
  max-width: 1320px;
  margin: 0 auto;
}
.event-detail-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.event-detail-menu {
  position: sticky;
  top: 86px;
  padding: 14px;
}
.event-detail-menu-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: #4a607b;
}
.event-detail-menu-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event-detail-menu-link {
  text-decoration: none;
  font-size: 13px;
  color: #294b70;
  border: 1px solid #d6e1ee;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fbff;
}
.event-detail-menu-link:hover {
  background: #eef5ff;
}
.event-detail-card {
  padding: 24px;
}
.event-detail-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event-detail-visual-card {
  margin: 0 auto 16px;
  max-width: 800px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dbe5f2;
}
.event-detail-visual-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  background: #e5ecf5;
}
.event-detail-visual-meta {
  padding: 10px 14px;
  border-top: 1px solid #e4ebf5;
  background: #f8fbff;
}
.event-detail-visual-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: #506a89;
  border: 1px solid #d4e0ee;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
}
.event-detail-article {
  max-width: 800px;
}
.event-detail-main-title {
  margin-bottom: 10px;
}
.event-detail-head-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e9f3;
}
.event-detail-head-avatar {
  width: 42px;
  height: 42px;
}
.event-detail-head-author-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.event-detail-head-author-name {
  font-size: 15px;
  font-weight: 700;
  color: #233f61;
}
.event-detail-head-author-role {
  font-size: 12px;
  color: #6d8098;
}
.event-detail-body {
  margin-bottom: 26px;
}
.event-detail-intro {
  margin-bottom: 20px;
}
.event-detail-info-block {
  margin: 0 0 16px;
}
.event-detail-meta-joined {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d6e2f0;
  background: #f8fbff;
}
.event-detail-meta-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  column-gap: 1.5em;
  row-gap: 8px;
}
.event-detail-meta-row + .event-detail-meta-row {
  margin-top: 8px;
}
.event-detail-meta-label {
  font-size: 15px;
  font-weight: 800;
  color: #1f3b5f;
  letter-spacing: 0.01em;
}
.event-detail-meta-value {
  font-size: 15px;
  line-height: 1.7;
  color: #213a5a;
  font-weight: 700;
}
.event-detail-meta-sub {
  display: inline-block;
  margin-top: 2px;
  color: #3a5370;
  font-weight: 600;
}
.event-detail-block-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: #415c7f;
  letter-spacing: 0.03em;
}
.event-detail-block-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #2e4158;
}
.event-attend-callout {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed #cad8ea;
  background: #f8fbff;
  color: #38516f;
  font-size: 13px;
  line-height: 1.7;
}
.event-detail-hero {
  margin: -24px -24px 16px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background: #dde6f2;
  aspect-ratio: 16 / 8;
}
.event-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.event-detail-title {
  margin: 0 0 14px;
  font-size: clamp(24px, 3.1vw, 34px);
  line-height: 1.35;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.event-detail-date {
  font-size: 14px;
  color: #4a5e75;
  margin-bottom: 14px;
}
.event-detail-description {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 12px;
}
.event-detail-location {
  margin: 0;
  font-size: 13px;
  color: #1f2f4a;
}
.event-detail-attend-actions {
  margin-top: 14px;
  align-items: center;
  gap: 8px;
}
.event-detail-attend-actions button,
.event-open-detail-btn {
  min-width: 0;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 999px;
}
.event-open-detail-btn {
  text-decoration: none !important;
}
.event-preview-manage {
  margin-top: 8px;
  gap: 8px;
}
.event-attendee-list {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.event-attendee-title {
  margin: 0 0 12px;
  font-size: 14px;
}
.event-attendee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f8fb;
  margin-bottom: 8px;
}
.event-attendee-row.empty {
  color: var(--muted);
}
.event-attendee-name {
  color: #1f2f4a;
}
.event-attendee-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.event-attendee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #d5dfeb;
  background: #eef4fb;
}
.event-attendee-status {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d8e4f3;
  color: #274567;
}
.event-attendee-status.yes {
  background: #d7f3df;
  color: #1a6b2f;
}
.event-attendee-status.maybe {
  background: #fff0cc;
  color: #8f6400;
}
.event-attendee-status.no {
  background: #ffe0dc;
  color: #8d2a1f;
}
.event-attendee-status.unknown {
  background: #e5ebf3;
  color: #3f4f66;
}
.event-detail-rsvp {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid #d4e0ef;
  border-radius: 12px;
  background: #f6f9fe;
  font-size: 14px;
}
.event-detail-rsvp-label {
  font-weight: 700;
  color: #2c496b;
}
.event-detail-rsvp label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.event-detail-rsvp input[type="radio"] {
  width: auto;
  margin: 0;
}
.event-location-card {
  margin: 0 0 18px;
  border: 1px solid #d9e3f0;
  border-radius: 18px;
  overflow: hidden;
  background: #f9fbff;
}
.event-location-map-wrap {
  border-bottom: 1px solid #e2eaf5;
  background: #e8eef7;
}
.event-mini-map-frame {
  display: block;
  width: 100%;
  height: 250px;
  border: 0;
}
.event-location-content {
  padding: 14px 16px 16px;
}
.event-location-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #6b7f98;
  margin-bottom: 8px;
}
.event-location-primary {
  margin: 0;
  color: #304760;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 600;
  letter-spacing: 0.01em;
  word-break: break-word;
}
.event-location-secondary {
  margin: 10px 0 0;
  padding-left: 12px;
  border-left: 4px solid #d8e4f4;
  color: #4f6279;
  font-size: 13px;
  line-height: 1.65;
}
.event-form-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}
.event-form-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 34, 50, 0.52);
  backdrop-filter: blur(2px);
}
.event-form-sheet {
  position: relative;
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid #dbe5f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  box-shadow: 0 26px 46px rgba(19, 41, 68, 0.3);
  padding: 18px 18px 16px;
}
.event-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.event-form-head h2 {
  margin: 0;
  color: #1e3d5e;
  font-size: 19px;
}
.event-form-close {
  border: 1px solid #cfd8e5;
  background: #fff;
  color: #2c4666;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  line-height: 1;
  font-size: 20px;
  cursor: pointer;
}
.event-form-close:hover {
  background: #f1f5fa;
}
.event-form-stack {
  gap: 12px;
}
.event-post-form-card {
  margin-bottom: 18px;
}
.event-post-form-card .toolbar {
  margin-bottom: 12px;
}
.event-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.event-tag-chip {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #d6dfeb;
  border-radius: 999px;
  background: #fff;
  color: #4d627b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.event-tag-chip:hover {
  border-color: #b9dfff;
  background: #eef8ff;
  color: #2b6fca;
  transform: translateY(-1px);
}
.event-tag-chip.is-selected {
  border-color: #b7e3f5;
  background: #dff5ff;
  color: #2b6e83;
}
.event-form-block {
  display: grid;
  gap: 8px;
}
.event-form-block-label {
  font-size: 14px;
  font-weight: 600;
  color: #2d4b6c;
}
.event-form-block-label span {
  font-size: 11px;
  font-weight: 600;
  color: #627a96;
  margin-left: 4px;
}
.event-form-stack textarea {
  min-height: 130px;
}
.event-form-stack textarea[name="description"] {
  min-height: 240px;
}
.event-form-stack textarea[name="location"] {
  min-height: 88px;
}
.event-form-stack textarea[name="map_embed"] {
  min-height: 100px;
}
.event-time-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.event-time-row > div {
  min-width: 0;
}
.event-time-row label {
  font-size: 14px;
  font-weight: 600;
  color: #2d4b6c;
}
.event-timezone-select {
  background: #fff;
  color: #2d4b6c;
  font-weight: 400;
  text-align: left;
  letter-spacing: 0.02em;
}
.event-timezone-select option {
  font-weight: 400;
  color: #2d4b6c;
}
.event-form-action-btn {
  border: 1px solid #c8d6ea;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
}
.event-dialog-submit {
  background: linear-gradient(135deg, #2a7de1, #2368be);
  color: #fff;
  border-color: #1f5eab;
}
.event-dialog-submit:hover {
  filter: brightness(1.05);
}
.event-dialog-close {
  background: #f8fbff;
  color: #214365;
}
.event-image-picker {
  border: 1px dashed #b9cce4;
  border-radius: 12px;
  background: #f7fbff;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.event-image-picker label {
  font-size: 14px;
  font-weight: 600;
  color: #2d4b6c;
}
.event-image-preview {
  border-radius: 10px;
  overflow: hidden;
  background: #eaf2fc;
}
.event-image-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}
.event-image-preview p {
  margin: 0;
  padding: 6px 8px;
  font-size: 12px;
  color: #355378;
}
.event-form-submit-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}
.event-form-submit-primary {
  min-height: 46px;
  padding: 0 24px;
  border-radius: 14px;
  border: 1px solid #b8dfef;
  background: #dff5ff;
  color: #295e73;
  box-shadow: none;
}
.event-form-submit-primary:hover {
  background: #d2f0fd;
}
.album-detail-shell {
  max-width: 920px;
  margin: 0 auto 24px;
  padding: 28px;
}
.album-detail-title {
  margin: 0 0 14px;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.album-upload-form {
  display: grid;
  gap: 16px;
  max-width: 640px;
}
.album-file-field {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f9fbfe;
  padding: 12px;
}
.album-file-field > span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.album-file-field input[type="file"] {
  width: 100%;
  max-width: 100%;
  font-size: 15px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.album-caption-input {
  font-size: 16px;
}
.album-upload-form button {
  width: 100%;
  max-width: 420px;
}
.album-detail-grid {
  max-width: 920px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .event-detail-card,
  .album-detail-shell {
    padding: 22px 18px;
  }
  .event-detail-layout {
    grid-template-columns: 1fr;
  }
  .event-detail-menu {
    position: static;
  }
  .event-detail-hero {
    margin: -22px -18px 14px;
  }
  .event-detail-title {
    font-size: clamp(20px, 6.4vw, 28px);
  }
  .event-detail-meta-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 6px;
  }
  .event-detail-meta-label,
  .event-detail-meta-value {
    font-size: 14px;
  }
  .event-mini-map-frame {
    height: 200px;
  }
  .event-location-primary {
    font-size: 15px;
  }
  .album-detail-title {
    font-size: clamp(34px, 10vw, 54px);
  }
}
.meta {
  font-size: 13px;
  color: var(--muted);
}
.hidden { display: none !important; }
.notice-body, .sql-block {
  white-space: pre-wrap;
  word-break: break-word;
}

/* 笏笏 繝懊ヨ繝繝翫ン 笏笏 */
.bottom-nav {
  display: none;
}

/* 笏笏 繧｢繝ｩ繝ｼ繝・笏笏 */
.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  background: rgba(30, 142, 62, 0.1);
  border: 1px solid rgba(30, 142, 62, 0.2);
  color: #1e8e3e;
  margin-bottom: 16px;
}
.alert.error {
  background: rgba(217, 48, 37, 0.1);
  border-color: rgba(217, 48, 37, 0.2);
  color: var(--danger);
}

/* 笏笏 騾夂衍繝吶Ν繝ｻ繝峨Ο繝・・繝繧ｦ繝ｳ 笏笏 */
.notification-bell-container {
  position: relative;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.notification-bell-container:hover {
  background: var(--bg);
}
.notification-bell-container.has-unread {
  color: #374151;
  box-shadow: none;
  animation: none;
}
.bell-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bell-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notification-bell-container .badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}
.notification-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 1280;
}
.dropdown-header {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-weight: bold;
}
.dropdown-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 6px;
}

.notif-category-item {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
}
.notif-category-item:hover {
  background: var(--bg);
}
.notif-category-label {
  font-size: 14px;
  font-weight: 600;
}
.notif-category-count {
  min-width: 30px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}
.notif-category-item.has-unread .notif-category-count {
  background: #1a73e8;
  color: #fff;
}
.notif-empty { padding: 20px; text-align: center; color: var(--muted); }

@keyframes notif-bell-glow {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.26);
  }
}

/* 笏笏 繝励Ξ繧ｼ繝ｳ繧ｹ繧､繝ｳ繧ｸ繧ｱ繝ｼ繧ｿ繝ｼ 笏笏 */
.presence-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--panel);
}
.presence-indicator.online { background-color: var(--success); }
.presence-indicator.offline { background-color: var(--line); }

/* 笏笏 繝輔ぃ繝溘Μ繝ｼ繝・Μ繝ｼ 笏笏 */
.family-tree {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  --tree-node-width: 240px;
  --tree-node-height: 108px;
  --tree-avatar-size: 94px;
  --tree-pair-gap: 20px;
  padding: 20px 8px 16px;
  width: 100%;
  min-width: 980px;
}
.tree-tier-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--tree-lane-count, 5), minmax(150px, 1fr));
  gap: 12px;
  align-items: start;
}
.tree-dropzone-cell {
  position: relative;
  z-index: 1;
  min-height: calc(var(--tree-node-height) + 24px);
  padding: 8px 6px;
  border: 2px dashed transparent;
  border-radius: 14px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.tree-dropzone-cell--multi {
  flex-direction: row;
  flex-wrap: nowrap;
  align-content: center;
  justify-content: center;
  gap: var(--tree-pair-gap);
  padding-left: 10px;
  padding-right: 10px;
  overflow: visible;
}
.tree-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 7px 4px 7px 2px;
  border-radius: 10px;
  transition: transform 0.18s ease, filter 0.18s ease;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  width: var(--tree-node-width);
  height: var(--tree-node-height);
  min-width: 0;
  max-width: var(--tree-node-width);
  justify-content: flex-start;
}
.tree-dropzone-cell--multi .tree-node {
  flex: 0 0 var(--tree-node-width);
  width: var(--tree-node-width);
  min-width: var(--tree-node-width);
  max-width: var(--tree-node-width);
}
.tree-node:hover { transform: translateY(-1px); filter: saturate(1.05); }
.tree-node.tree-node-drop-target {
  outline: 2px dashed rgba(26, 115, 232, 0.6);
  outline-offset: 2px;
  background: rgba(148, 197, 255, 0.08);
}
.avatar-wrap {
  position: relative;
  width: var(--tree-avatar-size);
  height: var(--tree-avatar-size);
  flex: 0 0 var(--tree-avatar-size);
}
.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.1), 0 10px 24px rgba(17, 24, 39, 0.12);
}
.avatar-wrap .presence-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
}
.tree-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.tree-node .life-stage {
  font-size: 12px;
  font-weight: 600;
  color: #7c8698;
  line-height: 1.2;
}
.tree-node .name {
  margin-top: 0;
  font-size: clamp(16px, 1.2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.1;
  color: #0f172a;
  white-space: nowrap;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-bio-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 5;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
  transform: translate(-50%, 4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.tree-node:hover .tree-bio-tooltip,
.tree-node:focus-within .tree-bio-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.tree-connectors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.tree-connector-line {
  stroke: rgba(62, 84, 112, 0.5);
  stroke-width: 2;
  stroke-linecap: round;
}

/* 笏笏 繝輔ぃ繝溘Μ繝ｼ繝上ヶ 笏笏 */
.family-hub-summary {
  margin-bottom: 16px;
}
.family-hub-summary h2 {
  margin-bottom: 8px;
}
.family-hub-summary p {
  margin: 0;
  white-space: pre-wrap;
}
.family-hub-tabbar {
  margin-bottom: 14px;
}
.family-hub-shell {
  padding: 18px;
}
.family-hub-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}
.family-hub-tab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 10px 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.family-hub-tab:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}
.family-hub-tab.active {
  color: #fff;
  border-color: #0284c7;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.26);
}
.family-hub-segment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.family-hub-segment-head h3 {
  margin: 0 0 6px;
  font-size: 24px;
}
.family-hub-segment-head p {
  margin: 0;
}
.family-hub-segment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.family-hub-segment-actions .button-like,
.family-hub-segment-actions button {
  min-height: 42px;
}
.family-hub-notice-head {
  margin-bottom: 10px;
}
.family-hub-notice-toolbar {
  width: 100%;
  justify-content: flex-end;
}
.family-hub-notice-sections {
  display: grid;
  gap: 14px;
}
.family-hub-notice-section {
  display: grid;
  gap: 8px;
}
.family-hub-notice-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.family-hub-notice-section-tag {
  display: inline-block;
  width: fit-content;
  border: 0;
  background: transparent;
  color: #1e3a8a;
  padding: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.family-hub-notice-section-count {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.family-hub-notice-create-btn {
  border-radius: 999px;
}
.family-notice-create-screen {
  display: grid;
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.family-notice-create-screen__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.family-notice-create-screen__head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}
.family-notice-create-form {
  gap: 18px;
}
.family-notice-create-form-shell {
  display: grid;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.family-notice-create-title,
.family-notice-create-body {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94));
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.9);
}
.family-notice-create-title {
  min-height: 74px;
  padding: 0 22px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}
.family-notice-create-title::placeholder {
  color: #94a3b8;
  font-weight: 600;
}
.family-notice-create-body {
  min-height: 280px;
  padding: 22px;
  color: #1e293b;
  font-size: 16px;
  line-height: 1.8;
  resize: vertical;
}
.family-notice-create-body::placeholder {
  color: #94a3b8;
}
.family-notice-create-upload {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px dashed #bfdbfe;
  border-radius: 22px;
  background: rgba(239, 246, 255, 0.7);
}
.family-notice-create-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.family-notice-create-upload-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}
.family-notice-create-file-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  font-size: 14px;
}
.family-notice-create-file-input::file-selector-button {
  margin-right: 14px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.family-notice-create-upload-file {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.family-notice-create-actions {
  justify-content: flex-end;
}
.family-notification-list {
  display: grid;
  gap: 0;
  border: 1px solid #d7dee7;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.family-notification-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  color: #1f2937;
  border-bottom: 1px solid #e5eaf1;
  transition: background 0.18s ease, color 0.18s ease;
}
.family-notification-row:last-child {
  border-bottom: 0;
}
.family-notification-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ecf2f9;
  border: 1px solid #d7e2ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.family-notification-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.family-notification-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.family-notification-body {
  color: #4b5563;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.family-notification-meta {
  color: #64748b;
  font-size: 13px;
}
.family-notification-row:hover,
.family-notification-row:focus-visible {
  background: #e5e7eb;
  color: #1f2937;
  text-decoration: none;
}
.family-notification-row:hover .family-notification-body,
.family-notification-row:focus-visible .family-notification-body,
.family-notification-row:hover .family-notification-meta,
.family-notification-row:focus-visible .family-notification-meta {
  color: #4b5563;
}
.family-notification-row:hover .family-notification-icon,
.family-notification-row:focus-visible .family-notification-icon {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
.family-notification-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #d7e2ef;
  object-fit: cover;
  background: #ecf2f9;
}
.family-hub-inline-form {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.family-hub-list {
  display: grid;
  gap: 10px;
}
.family-hub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.family-hub-item-main {
  min-width: 0;
}
.family-hub-item-main h4 {
  margin: 0 0 4px;
  font-size: 20px;
}
.family-hub-item-main p {
  margin: 0 0 6px;
  color: #4b5563;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.family-hub-item .meta {
  color: var(--muted);
}
.family-hub-detail-link {
  flex: 0 0 auto;
  text-decoration: none;
  font-weight: 700;
}
.family-hub-subsection {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e1e6ec;
}
.family-hub-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.family-hub-subsection-head h4 {
  margin: 0;
  font-size: 18px;
}
.family-hub-system-announcements .button-like {
  min-width: 90px;
}
.family-hub-system-list {
  gap: 8px;
}
.family-hub-system-item {
  padding: 12px 14px;
  border-color: #dde4ee;
  background: #fbfcfe;
}
.family-hub-system-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.family-hub-system-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #d7e0ec;
  background: #eef3f9;
  color: #3b5f87;
  font-size: 12px;
  font-weight: 600;
}
.family-hub-album-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.family-hub-album-item {
  align-items: stretch;
}
.family-hub-album-cover {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #dbe5ef;
}
.family-public-album-list {
  display: grid;
  gap: 14px;
}
.family-public-album-row {
  border: 1px solid #dce4ee;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}
.family-public-album-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.family-public-album-owner {
  display: none;
}
.family-public-album-head h4 {
  margin: 0;
  font-size: 28px;
}
.family-public-album-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.family-public-album-photo {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 18px;
  overflow: hidden;
  background: #e5e7eb;
  aspect-ratio: 16 / 10;
  min-width: 190px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.11);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.family-public-album-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.24s ease;
}
.family-public-album-photo:hover,
.family-public-album-photo:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}
.family-public-album-photo:hover img,
.family-public-album-photo:focus-visible img {
  transform: scale(1.04);
}
.family-public-album-photo.is-more::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.52), rgba(30, 64, 175, 0.44));
}
.family-public-album-more-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.35);
}
.family-public-album-mobile-more-label {
  display: none;
}
.family-hub-member-item {
  align-items: center;
}
.family-hub-member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #d0d7e2;
}
.family-hub-subtitle {
  margin: 4px 0 0;
  color: #475569;
  font-weight: 700;
}
.family-hub-tree-panel {
  margin-bottom: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px;
}
.family-hub-tree-head h4 {
  margin: 0 0 6px;
}
.family-hub-tree-head p {
  margin: 0;
}
#family-hub-tree-container {
  margin-top: 10px;
  overflow-x: hidden;
  overflow-y: visible;
}
.family-members-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
}
.family-members-hero-card {
  position: relative;
  border-radius: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.family-members-hero-photo-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 0;
  box-shadow: none;
}
.family-members-hero-photo {
  display: block;
  width: 100%;
  height: clamp(260px, 32vw, 420px);
  object-fit: cover;
  background: #f7f7f8;
  opacity: 0.96;
  transition: opacity 0.45s ease;
}
.family-members-hero-photo.is-swapping {
  opacity: 1;
}
.family-members-hero-copy h4 {
  margin: 0 0 6px;
  font-size: clamp(34px, 3.6vw, 52px);
  color: #fff;
  text-shadow: 0 3px 14px rgba(15, 23, 42, 0.45);
}
.family-members-hero-copy p {
  margin: 0;
  font-size: clamp(16px, 1.5vw, 24px);
  line-height: 1.45;
  color: #fff;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.4);
}
.family-members-hero-copy {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 1100px);
  text-align: center;
  z-index: 3;
}
.family-members-hero-upload {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
}
.family-members-hero-upload input[type="file"] {
  display: none;
}
.family-members-hero-upload .button-like {
  margin: 0;
  cursor: pointer;
}
.family-members-hero-upload .muted {
  font-size: 11px;
  color: #5f6878;
}
.family-hero-copy-form {
  width: min(320px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.family-hero-copy-form input,
.family-hero-copy-form textarea {
  width: 100%;
  font: inherit;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2937;
}
.family-hero-copy-form textarea {
  resize: vertical;
}
.family-hub-tree-panel--scenic {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 0;
  background: transparent;
  padding: 16px;
  box-shadow: none;
}
.family-hub-tree-panel--scenic::before {
  display: none;
}
.family-hub-tree-panel--scenic::after {
  display: none;
}
.family-hub-tree-panel--scenic .family-hub-tree-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.family-hub-tree-panel--scenic .family-hub-tree-head .button-like,
.family-hub-tree-panel--scenic .family-hub-tree-head button {
  position: relative;
  z-index: 3;
}
.family-hub-tree-canvas {
  position: relative;
  z-index: 1;
  margin: 10px -16px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.family-hub-tree-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/images/members-tree-bg.jpg") center/cover no-repeat;
  opacity: 0.34;
  z-index: 0;
  pointer-events: none;
}
.family-hub-tree-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.42);
  z-index: 0;
  pointer-events: none;
}
.family-hub-tree-canvas #family-hub-tree-container {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding: 8px 0 0;
}

/* 笏笏 繧ｯ繧ｪ繝ｼ繧ｿ繝舌・ 笏笏 */
.quota-container { margin: 10px 0; }
.quota-bar {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.quota-fill {
  height: 100%;
  background: var(--success);
}

/* 笏笏 繝√Ε繝・ヨ 笏笏 */
.chat-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}
.chat-bubble-wrap.mine {
  flex-direction: row-reverse;
}
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
}
.chat-bubble-wrap.mine .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* 笏笏 Masonry Grid (Item 8) 笏笏 */
.masonry-grid {
  columns: 3;
  column-gap: 16px;
}
.masonry-grid .photo-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  background: var(--bg);
}
.masonry-grid .photo-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.photo-item img {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
}
.photo-item .photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 12px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s;
}
.masonry-grid .photo-item:hover .photo-caption {
  opacity: 1;
}

@media (max-width: 800px) {
  .masonry-grid { columns: 2; }
}
@media (max-width: 500px) {
  .masonry-grid { columns: 1; }
}

/* 笏笏 繝ｩ繧､繝医・繝・け繧ｹ・亥・逵溷・逕ｻ髱｢陦ｨ遉ｺ・・笏笏 */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  touch-action: pan-y;
}
.lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: 0.02em;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

@media (max-width: 767px) {
  .lightbox-overlay img {
    max-width: 100%;
    max-height: 82%;
    border-radius: 0;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .lightbox-nav.prev {
    left: 10px;
  }

  .lightbox-nav.next {
    right: 10px;
  }

  .lightbox-counter {
    bottom: 14px;
    font-size: 11px;
  }
}

/* 笏笏 繧､繝ｳ繝ｩ繧､繝ｳ邱ｨ髮・畑 笏笏 */
.inline-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* 笏笏 繝繝・す繝･繝懊・繝峨メ繝・・ 笏笏 */
.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 24px;
}
.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.dash-chip:hover {
  background: var(--bg);
  box-shadow: var(--shadow);
  text-decoration: none;
}

/* 笏笏 Profile/Avatar Dashboard (Item 7) 笏笏 */
.dash-profile-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 30px;
}
.dash-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.dash-user-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}
.dash-user-email {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
}
.dash-search {
  width: 100%;
  max-width: 600px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 15px;
  color: var(--text);
  margin: 0 auto 30px;
  display: block;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dash-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
  outline: none;
}

/* 笏笏 繧ｷ繧ｹ繝・Β邂｡逅・繝繝・す繝･繝懊・繝・笏笏 */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-detail {
  font-size: 12px;
  color: var(--muted);
}

.admin-features {
  margin-bottom: 32px;
}
.admin-features h2,
.admin-groups h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.feature-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  border: 2px solid transparent;
}
.feature-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.feature-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text);
}
.feature-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.0;
  margin: 0 0 12px 0;
}
.feature-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.admin-groups {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.admin-groups .list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 笏笏 繝悶Ο繧ｰ髢｢騾｣ 笏笏 */
.blog-masonry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 1100px) {
  .blog-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .blog-masonry {
    grid-template-columns: 1fr;
  }
}
.blog-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.blog-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--panel-2);
}
.blog-card-content {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.blog-tag {
  font-size: 11px;
  background: rgba(26, 115, 232, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}
.blog-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text);
}
.blog-card-excerpt {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.blog-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.blog-card-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.blog-card-author-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
}
.blog-card-date {
  white-space: nowrap;
}
.blog-card-metrics {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  gap: 10px;
}
.blog-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 20px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.blog-filters::-webkit-scrollbar { display: none; }

.filter-btn {
  white-space: nowrap;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  color: var(--muted);
}
.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.blog-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--panel);
}

.blog-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.blog-editor-btn {
  width: auto;
  min-width: 120px;
  justify-content: center;
}

.blog-editor-upload-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.blog-editor-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-editor-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 10px;
}

.blog-editor-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.blog-editor-block textarea,
.blog-editor-block input {
  width: 100%;
}

.blog-editor-text-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.blog-editor-select-chip,
.blog-editor-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 0;
}

.blog-editor-select-chip {
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.blog-editor-select-chip select {
  border: 0;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.blog-editor-toggle-chip {
  padding: 0 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.blog-editor-toggle-chip::before {
  content: "笘・;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
}

.blog-editor-toggle-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

.blog-editor-toggle-chip:has(input:checked) {
  border-color: #93c5fd;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(239, 246, 255, 0.98));
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
}

.blog-editor-toggle-chip:has(input:checked)::before {
  content: "笘・;
  color: #1d4ed8;
}

.blog-editor-toggle-chip:has(input:checked) .blog-editor-chip-icon,
.blog-editor-toggle-chip:has(input:checked) .blog-editor-chip-text {
  color: #1d4ed8;
}

.blog-editor-chip-icon {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.blog-editor-chip-text {
  min-width: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.blog-editor-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.blog-editor-inline-check input {
  width: auto;
}

.blog-editor-inline-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.blog-editor-tool-btn {
  width: auto;
  min-width: 120px;
  padding: 6px 10px;
}

.blog-editor-tool-icon {
  flex: 0 0 auto;
}

.blog-editor-tool-text {
  min-width: 0;
}

.blog-editor-main-textarea {
  min-height: 260px;
  resize: vertical;
}

.blog-editor-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px;
}

.blog-editor-preview-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.blog-editor-preview-body {
  min-height: 80px;
}

.blog-post-compose-screen {
  display: grid;
  gap: 18px;
}

.blog-post-compose-screen--clean {
  gap: 20px;
}

.blog-post-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.blog-post-compose-head h1 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.blog-post-compose-form {
  display: grid;
  gap: 18px;
}

.blog-post-compose-title {
  width: 100%;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid #d7e2ef;
  border-radius: 22px;
  outline: 0;
  background: #fff;
  color: #16345d;
  font-size: 14px;
  font-weight: 600;
}

.blog-post-compose-title::placeholder {
  color: #4b607d;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.blog-post-compose-tags-field {
  display: block;
}

.blog-post-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.blog-post-tag-option {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 32px;
  padding: 0 16px;
  border: 1px solid #c9d7ea;
  border-radius: 999px;
  background: #fff;
  color: #35557f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.blog-post-tag-option:has(input:checked) {
  border-color: #9fd3f5;
  background: #d7f0ff;
  color: #1f5f84;
  box-shadow: none;
}

.blog-post-tag-option.is-selected {
  border-color: #9fd3f5;
  background: #d7f0ff;
  color: #1f5f84;
  box-shadow: none;
}

.blog-post-tag-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

.blog-post-compose-editor-field {
  display: grid;
}

.blog-post-compose-editor-shell {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.blog-post-compose-screen--clean .blog-editor {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.blog-post-compose-screen--clean .blog-editor-block {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.blog-post-compose-editor-shell .blog-editor {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.blog-post-compose-editor-shell .blog-editor-compose-shell {
  display: grid;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.blog-post-compose-editor-shell .blog-editor-text-tools,
.blog-post-compose-editor-shell .blog-editor-inline-tools {
  gap: 6px;
  margin-bottom: 6px;
}

.blog-post-compose-editor-shell .blog-editor-text-tools {
  row-gap: 6px;
  column-gap: 6px;
  margin-bottom: 4px;
}

.blog-post-compose-editor-shell .blog-editor-select-chip,
.blog-post-compose-editor-shell .blog-editor-toggle-chip,
.blog-post-compose-editor-shell .blog-editor-tool-btn {
  min-height: 21px;
  height: 21px;
  border-radius: 10px;
  border-color: #d7e2ef;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  line-height: 1.2;
}

.blog-post-compose-editor-shell .blog-editor-select-chip {
  padding: 0 6px;
}

.blog-post-compose-editor-shell .blog-editor-toggle-chip {
  padding: 0 6px;
}

.blog-post-compose-editor-shell .blog-editor-tool-btn {
  padding: 0 6px;
}

.blog-post-compose-editor-shell .blog-editor-select-chip select,
.blog-post-compose-editor-shell .blog-editor-chip-text,
.blog-post-compose-editor-shell .blog-editor-tool-text {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #29496d;
}

.blog-post-compose-editor-shell .blog-editor-chip-icon,
.blog-post-compose-editor-shell .blog-editor-tool-icon {
  font-size: 10px;
  line-height: 1.2;
  color: #6a7e99;
}

.blog-post-compose-editor-shell .blog-editor-main-textarea {
  min-height: 210px;
  padding: 18px;
  border: 1px solid #d7e2ef;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(249, 252, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: #16345d;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.blog-post-compose-screen--clean .blog-editor-main-textarea {
  min-height: 240px;
  padding: 22px 24px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.95));
  box-shadow: none;
  color: #183152;
  font-size: 15px;
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.01em;
}

.blog-post-compose-editor-shell .blog-editor-main-textarea::placeholder {
  color: #4b607d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.blog-post-compose-editor-shell .blog-editor-preview {
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(247, 250, 253, 0.94), rgba(241, 246, 251, 0.92));
  border-color: #d7e2ef;
}

.blog-post-compose-screen--clean .blog-editor-preview {
  padding: 0;
  border: 0;
  background: transparent;
}

.blog-post-compose-editor-shell .blog-editor-preview-body {
  min-height: 64px;
  color: #4b607d;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.blog-post-compose-screen--clean .blog-editor-preview-body {
  min-height: 90px;
  padding: 4px 2px 0;
  color: #183152;
  font-size: 15px;
  line-height: 1.95;
}

.blog-post-edit-screen {
  padding: 0;
}

.blog-post-edit-form {
  gap: 18px;
}

.blog-post-edit-screen .blog-post-tags-wrap {
  gap: 10px 8px;
}

.blog-post-edit-screen .blog-post-tag-option {
  min-height: 28px;
  padding: 0 12px;
  font-size: 13px;
}

.blog-post-edit-screen .blog-post-tag-option span {
  white-space: nowrap;
}

.blog-post-edit-screen .blog-editor-blocks {
  gap: 14px;
}

.blog-post-edit-screen .blog-editor-select-chip,
.blog-post-edit-screen .blog-editor-toggle-chip,
.blog-post-edit-screen .blog-editor-tool-btn {
  border-color: rgba(120, 141, 168, 0.28);
}

.blog-post-edit-screen .blog-editor-main-textarea {
  min-height: 280px;
  padding: 22px 24px;
  border: 1px solid #d7e2ef;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: #183152;
  font-size: 15px;
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.01em;
}

.blog-post-edit-screen .blog-editor-preview {
  padding: 14px 16px;
  border: 1px solid #d7e2ef;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(247, 250, 253, 0.96), rgba(241, 246, 251, 0.94));
}

.blog-post-edit-screen .blog-editor-preview-body {
  min-height: 90px;
  color: #183152;
  font-size: 15px;
  line-height: 1.95;
}

.blog-post-compose-actions {
  justify-content: flex-end;
}

.blog-post-compose-cancel,
.blog-post-compose-back {
  text-decoration: none;
}

@media (max-width: 820px) {
  .blog-post-compose-head {
    align-items: flex-start;
  }
  .blog-post-compose-head h1 {
    font-size: 14px;
  }
  .blog-post-compose-title {
    min-height: 44px;
    padding: 0 18px;
    font-size: 14px;
  }
  .blog-post-tag-option {
    min-height: 32px;
    padding: 0 14px;
    font-size: 14px;
  }
  .blog-post-compose-editor-shell {
    padding: 0;
    border-radius: 0;
  }
  .blog-post-compose-editor-shell .blog-editor-compose-shell {
    padding: 0;
    border-radius: 0;
  }
  .blog-post-compose-editor-shell .blog-editor-main-textarea {
    min-height: 180px;
    padding: 16px;
    border-radius: 18px;
  }
  .blog-post-compose-screen--clean .blog-editor-main-textarea {
    min-height: 200px;
    padding: 18px 18px 20px;
    border-radius: 22px;
  }
  .blog-post-compose-screen--clean .blog-editor-preview-body {
    font-size: 14px;
    line-height: 1.9;
  }
  .blog-post-compose-actions {
    justify-content: stretch;
  }
  .blog-post-compose-actions .notice-mini-btn {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* 笏笏 繝悶Ο繧ｰ隧ｳ邏ｰ 笏笏 */
.blog-article {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--line);
}
.blog-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}
.blog-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}
.blog-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.blog-content {
  display: grid;
  gap: 18px;
  font-size: 17px;
  line-height: 1.95;
  color: #24364f;
  margin-bottom: 40px;
}

.blog-rich-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 17px;
  line-height: 2;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.blog-embedded-image {
  margin: 0 0 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.blog-embedded-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.blog-code-block {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #111827;
}

.blog-code-block figcaption {
  margin: 0;
  padding: 8px 12px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.blog-code-block pre {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  overflow: auto;
}

.blog-code-block code {
  color: #e5e7eb;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 14px;
}

.blog-date-block {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef6ff;
  border: 1px solid #c8defd;
  color: #1f3f69;
  font-size: 14px;
}

.blog-location-card {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  background: var(--panel);
}

.blog-map-frame {
  display: block;
  width: 100%;
  height: min(72vh, 560px);
  min-height: 320px;
  border: 0;
  border-radius: 0;
  background: #dbe5f1;
}

@media (max-width: 768px) {
  .blog-map-frame {
    height: 52vh;
    min-height: 260px;
  }
}

.blog-video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 24px 0;
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow);
}
.blog-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.blog-actions {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  transition: all 0.2s;
  padding: 8px 12px;
  border-radius: var(--radius);
}
.action-btn:hover {
  background: var(--panel-2);
  color: var(--accent);
}
.action-btn.liked {
  color: var(--danger);
}

.comment-section h3 {
  margin-bottom: 20px;
  font-size: 18px;
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.comment-item {
  display: flex;
  gap: 12px;
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.comment-bubble {
  background: var(--panel-2);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  flex-grow: 1;
  border: 1px solid var(--line);
}
.comment-author {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.comment-text {
  font-size: 15px;
  line-height: 1.5;
}
.comment-form {
  margin-top: 30px;
  display: flex;
  gap: 12px;
}
.comment-input {
  flex-grow: 1;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 15px;
}

/* Chat v2 (WhatsApp-like) */
.chat-layout.chat-v2 {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 0;
  height: calc(100vh - 120px);
  border: 1px solid #d8e0e6;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f6f8;
}
.chat-v2 .chat-sidebar {
  width: auto;
  border-right: 1px solid #dbe3e9;
  background: #f7f9fb;
}
.chat-v2 .chat-sidebar h3 {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid #e4ebf0;
  font-size: 18px;
  color: #23313d;
}
.chat-v2 .chat-peer-list {
  overflow-y: auto;
  padding: 8px;
}
.chat-v2 .chat-peer-item {
  display: block;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.chat-v2 .chat-peer-item:hover {
  background: #f1f5f8;
  border-color: #e2e8ee;
}
.chat-v2 .chat-peer-item.active {
  background: #eaf1f6;
  border-color: #d5e0e9;
}
.chat-v2 .chat-peer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-v2 .chat-peer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #d7e0e8;
  background: #eff3f6;
}
.chat-v2 .chat-peer-main {
  min-width: 0;
  flex: 1;
}
.chat-v2 .chat-peer-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.chat-v2 .chat-peer-top-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chat-v2 .chat-peer-name {
  font-size: 14px;
  color: #1a2b38;
  line-height: 1.25;
}
.chat-v2 .chat-peer-time {
  font-size: 11px;
  color: #7b8d9a;
}
.chat-v2 .chat-peer-login {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #81919d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-v2 .chat-peer-login-label {
  color: #8a98a3;
}
.chat-v2 .chat-peer-login-time {
  color: #556573;
  font-weight: 500;
}
.chat-v2 .chat-main {
  background: #fbfcfd;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.chat-v2 .chat-main-header {
  min-height: 48px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dce4ea;
  background: #f6f8fa;
}
.chat-v2 .chat-mobile-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.chat-v2 .chat-mobile-header-row .chat-header-peer,
.chat-v2 .chat-mobile-header-row .chat-peer-name {
  min-width: 0;
}
.chat-v2 .chat-mobile-back-btn {
  flex: 0 0 auto;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  aspect-ratio: 1 / 1;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.chat-v2 .chat-mobile-back-btn:hover {
  background: #f8fafc;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}
.chat-v2 .chat-mobile-back-btn:focus-visible {
  outline: 2px solid #2f7cf6;
  outline-offset: 2px;
}
.chat-v2 .chat-mobile-back-btn svg {
  width: 17px;
  height: 17px;
  display: block;
  overflow: visible;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-v2 .chat-to-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.chat-v2 .chat-to-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #6f8190;
  text-transform: uppercase;
}
.chat-v2 .chat-to-label::after {
  content: ":";
  margin-left: 2px;
}
.chat-v2 .chat-to-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid #d8e2ea;
  background: #f1f5f8;
}
.chat-v2 .chat-to-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #d5dee7;
  background: #eef2f5;
}
.chat-v2 .chat-to-name {
  font-size: 15px;
  color: #243645;
  line-height: 1;
}
.chat-v2 .chat-messages {
  flex: 1;
  overflow-y: scroll;
  padding: 20px 24px;
  background: #f8fafb;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.chat-v2 .chat-date-float {
  position: absolute;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(21, 34, 45, 0.72);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 12px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.chat-v2 .chat-messages::-webkit-scrollbar {
  width: 10px;
}
.chat-v2 .chat-messages::-webkit-scrollbar-thumb {
  background: #c6ced6;
  border-radius: 999px;
}
.chat-v2 .chat-messages::-webkit-scrollbar-track {
  background: #f4f6f8;
}
.chat-v2 .chat-empty-state {
  margin: auto;
  text-align: center;
  color: #637381;
}
.chat-v2 .chat-empty-icon {
  font-size: 42px;
  margin-bottom: 10px;
}
.chat-v2 .chat-empty-state-friendly {
  max-width: 520px;
  padding: 34px 30px;
  border-radius: 22px;
  border: 1px solid #d8e7dc;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(112, 193, 148, 0.22) 0%, rgba(112, 193, 148, 0) 64%),
    radial-gradient(120% 120% at 0% 100%, rgba(86, 157, 223, 0.16) 0%, rgba(86, 157, 223, 0) 62%),
    linear-gradient(145deg, #ffffff 0%, #f5fbf8 100%);
  box-shadow: 0 18px 38px rgba(36, 60, 77, 0.12);
  color: #32485a;
}
.chat-v2 .chat-empty-state-friendly .chat-empty-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e3f3ea;
  color: #2f7a57;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.chat-v2 .chat-empty-state-friendly .chat-empty-icon {
  margin-bottom: 14px;
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 700;
  color: #2c4051;
  letter-spacing: 0.02em;
}
.chat-v2 .chat-empty-state-friendly p {
  margin: 0;
  color: #4f6779;
  font-size: 18px;
  line-height: 1.7;
}
.chat-v2 .chat-bubble-wrap {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 2px;
}
.chat-v2 .chat-bubble-wrap.mine {
  flex-direction: row;
  justify-content: flex-end;
}
.chat-v2 .chat-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #d4dce4;
  background: #f3f6f8;
}
.chat-v2 .chat-bubble {
  max-width: min(72%, 640px);
  background: #f6f7f8;
  color: #21303d;
  border: 1px solid #e5e9ed;
  border-radius: 10px;
  padding: 7px 9px 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.chat-v2 .chat-bubble-wrap:not(.mine) .chat-bubble {
  background: #f6f7f8 !important;
  color: #21303d !important;
}
.chat-v2 .chat-bubble-wrap.mine .chat-bubble {
  background: #e7f4e9;
  border-color: #d1e6d5;
}
.chat-v2 .chat-reply-quote {
  border-left: 3px solid #2e8f68;
  background: rgba(20, 54, 78, 0.08);
  padding: 5px 7px;
  border-radius: 7px;
  margin-bottom: 6px;
}
.chat-v2 .chat-reply-quote-label {
  font-size: 9px;
  font-weight: 700;
  color: #2e8f68;
  margin-bottom: 2px;
}
.chat-v2 .chat-reply-quote-body {
  font-size: 10px;
  color: #445864;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-v2 .chat-message-text {
  color: #21303d;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.chat-v2 .chat-image-link {
  display: block;
  margin-bottom: 0;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
  width: 100%;
}
.chat-v2 .chat-image-group-link {
  display: block;
  margin-bottom: 0;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
  width: 100%;
}
.chat-v2 .chat-image-group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}
.chat-v2 .chat-image-group-grid.count-1 {
  grid-template-columns: 1fr;
}
.chat-v2 .chat-image-group-item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 116px;
  overflow: hidden;
  border-radius: 10px;
}
.chat-v2 .chat-image-group-item.wide {
  grid-column: 1 / -1;
}
.chat-v2 .chat-image-group-thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 116px;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.chat-v2 .chat-image-group-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}
.chat-v2 .chat-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.chat-v2 .chat-bubble.has-image {
  padding: 0;
  overflow: hidden;
}
.chat-v2 .chat-bubble.has-image .chat-image-link {
  border-radius: 0;
}
.chat-v2 .chat-bubble.has-image .chat-image {
  border: 0;
  border-radius: 0;
}
.chat-v2 .chat-bubble.has-image .chat-reply-quote {
  margin: 7px 8px;
}
.chat-v2 .chat-bubble.has-image .chat-message-text {
  padding: 7px 8px;
}
.chat-v2 .chat-bubble.has-image .chat-bubble-foot {
  margin-top: 0;
  padding: 5px 8px 7px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: inherit;
}
.chat-v2 .chat-bubble-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 5px;
}
.chat-v2 .chat-delete-btn {
  border: none;
  background: transparent;
  color: #546270;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.chat-v2 .chat-delete-btn:hover {
  text-decoration: underline;
}
.chat-v2 .chat-reply-btn {
  border: none;
  background: transparent;
  color: #2c7f60;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
}
.chat-v2 .chat-reply-btn:hover {
  text-decoration: underline;
}
.chat-v2 .chat-bubble .meta {
  margin: 0;
  font-size: 9px;
  color: #738493;
}
.chat-v2 .chat-inline-tail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  white-space: nowrap;
  vertical-align: baseline;
}
.chat-v2 .chat-inline-tail .meta,
.chat-v2 .chat-inline-tail .chat-status-check {
  display: inline-block;
  line-height: 1;
}
.chat-v2 .chat-status-check {
  font-size: 11px;
  color: #2f7bf0;
  letter-spacing: -1px;
}
.chat-v2 .chat-input-area {
  display: block;
  padding: 6px 10px 10px;
  position: sticky;
  bottom: 0;
  background: #f7faf9;
  border-top: 1px solid #dce4ea;
  z-index: 2;
}
.chat-v2 .chat-reply-preview {
  margin-bottom: 6px;
  padding: 6px 8px;
  border-left: 3px solid #2e8f68;
  background: #eef6f2;
  border-radius: 7px;
}
.chat-v2 .chat-reply-preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.chat-v2 .chat-reply-preview-label {
  font-size: 10px;
  color: #2e8f68;
  font-weight: 700;
}
.chat-v2 .chat-reply-preview-body {
  margin-top: 2px;
  font-size: 10px;
  color: #425563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-v2 .chat-reply-cancel {
  border: none;
  background: transparent;
  color: #5a6c79;
  cursor: pointer;
  font-size: 12px;
}
.chat-v2 .chat-input-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 6px;
}
.chat-v2 .chat-attach-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: linear-gradient(180deg, #ffffff 0%, #edf3f6 100%);
  border: 1px solid #d7e1e8;
  box-shadow: 0 4px 10px rgba(47, 63, 75, 0.06);
  font-size: 16px;
  line-height: 1;
  user-select: none;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  color: #496272;
}
.chat-v2 .chat-camera-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #d7e1e8;
  background: linear-gradient(180deg, #ffffff 0%, #edf3f6 100%);
  color: #506270;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(47, 63, 75, 0.06);
}
.chat-v2 .chat-camera-btn svg {
  width: 15px;
  height: 15px;
  fill: #4f5f6b;
}
.chat-v2 .chat-camera-btn:hover {
  background: #f2f5f8;
}
.chat-v2 .chat-send-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #c8dfd1;
  background: linear-gradient(180deg, #f0f8f3 0%, #e0f0e7 100%);
  color: #2f7053;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(47, 112, 83, 0.10);
}
.chat-v2 .chat-send-icon-btn svg {
  width: 15px;
  height: 15px;
  fill: #2f7053;
}
.chat-v2 .chat-send-icon-btn:hover {
  background: #deeee4;
}
.chat-v2 .chat-attach-btn.has-file {
  background: #1f9d67;
  border-color: #1a8d5d;
  color: #fff;
}
.chat-v2 .chat-file-input-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.chat-v2 .chat-submit-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}
.chat-v2 .chat-input-row textarea[name="body"] {
  min-width: 0;
  border-radius: 14px;
  border: 1px solid #d7e1e8;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  padding: 8px 12px;
  min-height: 32px;
  max-height: 110px;
  resize: none;
  line-height: 1.35;
  overflow-y: auto;
  font: inherit;
  font-size: 11px;
  color: #23313d;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 4px 12px rgba(46, 66, 80, 0.04);
}
.chat-v2 .chat-message-menu {
  position: fixed;
  width: 140px;
  background: #fff;
  border: 1px solid #d7dee5;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 9100;
}
.chat-v2 .chat-message-menu button {
  width: 100%;
  border: 0;
  background: #fff;
  color: #1f2e3a;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}
.chat-v2 .chat-message-menu button:hover {
  background: #f3f7fa;
}
.chat-forward-picker {
  position: fixed;
  inset: 0;
  z-index: 9250;
  display: grid;
  place-items: center;
}
.chat-forward-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 32, 0.42);
}
.chat-forward-picker__panel {
  position: relative;
  width: min(560px, calc(100vw - 36px));
  max-height: min(82vh, 700px);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d8e0e7;
  box-shadow: 0 20px 48px rgba(16, 24, 32, 0.3);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.chat-forward-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5ebf0;
}
.chat-forward-picker__header h3 {
  margin: 0;
  font-size: 18px;
}
.chat-forward-picker__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #eef3f7;
  color: #425466;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.chat-forward-picker__list {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 10px;
  overflow: auto;
}
.chat-forward-picker__item {
  border: 1px solid #dbe4ea;
  border-radius: 12px;
  background: #fff;
  padding: 12px 8px 10px;
  display: grid;
  justify-items: center;
  gap: 8px;
  cursor: pointer;
}
.chat-forward-picker__item:hover {
  border-color: #9bc2ad;
  background: #f4fbf7;
}
.chat-forward-picker__item.is-selected {
  border-color: #1f6fe5;
  background: #eaf2ff;
}
.chat-forward-picker__avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #d0dae2;
  background: #f3f6f8;
}
.chat-forward-picker__name {
  font-size: 13px;
  color: #1f2e3a;
  text-align: center;
  word-break: break-word;
}
.chat-forward-picker__actions {
  border-top: 1px solid #e5ebf0;
  padding: 12px 14px;
  display: flex;
  justify-content: flex-end;
}
.chat-v2 .chat-camera-capture {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9200;
}
.chat-v2 .chat-camera-capture-panel {
  width: min(92vw, 560px);
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}
.chat-v2 .chat-camera-capture-panel video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}
.chat-v2 .chat-camera-capture-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px;
  background: #181818;
}
.chat-v2 .chat-camera-capture-actions button {
  border: 1px solid #4f5960;
  background: #2a3137;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.chat-v2 .chat-send-btn {
  width: auto;
  min-width: 82px;
  border-radius: 999px;
  padding: 10px 16px;
}
.chat-v2 .chat-image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.chat-v2 .chat-lightbox-image {
  width: min(90vw, 1100px);
  height: min(82vh, 760px);
  object-fit: contain;
  border-radius: 10px;
  background: #0a0a0a;
}
.chat-v2 .chat-lightbox-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 22, 25, 0.72);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.chat-v2 .chat-lightbox-close {
  top: 22px;
  right: 24px;
}
.chat-v2 .chat-lightbox-prev {
  left: 24px;
}
.chat-v2 .chat-lightbox-next {
  right: 24px;
}
.chat-v2 .chat-lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 999px;
}

/* Chat v2 refresh: sample-aligned layout */
.chat-layout.chat-v2 {
  grid-template-columns: 1fr 3fr;
  border-radius: 14px;
  background: #fff;
}
.chat-v2 .chat-sidebar {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
}
.chat-v2 .chat-main {
  background: #fff;
}
.chat-v2 .chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid #dfe6ee;
}
.chat-v2 .chat-sidebar-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #101828;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chat-v2 .chat-active-count {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dff2ed;
  color: #12b886;
  font-size: 12px;
  font-weight: 700;
}
.chat-v2 .chat-round-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #e8f0ff;
  color: #2372e5;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.chat-v2 .chat-round-icon-btn .chat-round-icon-label {
  display: inline-block;
  line-height: 1;
  transform: translateY(0.5px);
}
.chat-v2 .chat-round-icon-btn.active {
  background: #e8f0ff;
  color: #2372e5;
}
.chat-v2 .chat-group-compose-toggle-btn {
  min-width: 108px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #dff4e7;
  color: #1f8a57;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: none;
}
.chat-v2 .chat-group-compose-toggle-btn:hover {
  background: #d4efdf;
}
.chat-v2 .chat-group-compose-toggle-plus,
.chat-v2 .chat-group-compose-toggle-text {
  display: inline-block;
  line-height: 1;
}
.chat-v2 .chat-group-compose-bar {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-v2 .chat-group-compose-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
}
.chat-v2 .chat-group-compose-panel {
  position: relative;
  width: min(360px, calc(100vw - 28px));
  border-radius: 14px;
  border: 1px solid #d8e4f2;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  padding: 14px;
  display: grid;
  gap: 8px;
}
.chat-v2 .chat-group-compose-picker-list {
  max-height: min(44vh, 300px);
  overflow-y: auto;
  border: 1px solid #e1e9f3;
  border-radius: 10px;
  background: #f8fbff;
  padding: 6px;
  display: grid;
  gap: 4px;
}
.chat-v2 .chat-group-compose-picker-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #fff;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.chat-v2 .chat-group-compose-picker-item:hover {
  background: #edf4ff;
}
.chat-v2 .chat-group-compose-picker-item.is-selected {
  background: #e5f0ff;
}
.chat-v2 .chat-group-compose-picker-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
}
.chat-v2 .chat-group-compose-picker-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #fff;
}
.chat-v2 .chat-group-compose-picker-online-dot {
  position: absolute;
  right: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: #cfd4dc;
}
.chat-v2 .chat-group-compose-picker-online-dot.online {
  background: #16c784;
}
.chat-v2 .chat-group-compose-picker-name {
  font-size: 12px;
  color: #22364d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-v2 .chat-group-compose-picker-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #c8d7ea;
  background: #fff;
  color: transparent;
  font-size: 10px;
  display: inline-grid;
  place-items: center;
}
.chat-v2 .chat-group-compose-picker-item.is-selected .chat-group-compose-picker-check {
  border-color: #1f6fe5;
  background: #1f6fe5;
  color: #fff;
}
.chat-v2 .chat-group-compose-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #163154;
}
.chat-v2 .chat-group-compose-help {
  margin: 0;
  font-size: 12px;
  color: #5f7390;
}
.chat-v2 .chat-group-compose-count {
  font-size: 11px;
  color: #264a7a;
  font-weight: 700;
}
.chat-v2 .chat-group-compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.chat-v2 .chat-group-compose-create,
.chat-v2 .chat-group-compose-cancel {
  width: auto;
  min-width: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.chat-v2 .chat-group-compose-create:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chat-v2 .chat-group-compose-cancel {
  background: #fff;
  color: #38557a;
  border: 1px solid #c8d4e3;
}
.chat-v2 .chat-composed-group-list {
  margin: 0 12px;
  display: grid;
  gap: 0;
}
.chat-v2 .chat-composed-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #d7dde6;
  background: transparent;
  min-height: 46px;
  position: relative;
  overflow: visible;
  z-index: 1;
}
.chat-v2 .chat-composed-item.active {
  background: #eaf1ff;
  border-radius: 10px;
  border-bottom-color: transparent !important;
}
.chat-v2 .chat-composed-item:hover {
  background: #eaf1ff;
}
.chat-v2 .chat-composed-item.active:hover {
  background: #eaf1ff;
}
.chat-v2 .chat-composed-item.menu-open {
  z-index: 24;
}
.chat-v2 .chat-composed-avatars {
  display: inline-flex;
  align-items: center;
  padding-left: 4px;
}
.chat-v2 .chat-composed-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  margin-left: -5px;
}
.chat-v2 .chat-composed-name {
  display: block;
  font-size: 11px;
  color: #1a2d46;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-v2 .chat-composed-meta {
  min-width: 0;
}
.chat-v2 .chat-composed-sub {
  font-size: 9px;
  color: #6a7e94;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-v2 .chat-composed-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.chat-v2 .chat-composed-more-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: #e8f0ff;
  color: #2f6fcb;
  font-size: 11px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.chat-v2 .chat-composed-more-btn:hover {
  background: #dfeaff;
}
.chat-v2 .chat-composed-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 128px;
  background: #fff;
  border: 1px solid #d7e1eb;
  border-radius: 10px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
  z-index: 30;
  overflow: hidden;
}
.chat-v2 .chat-composed-menu-item {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #3c5169;
  font-size: 12px;
  text-align: left;
  padding: 9px 10px;
}
.chat-v2 .chat-composed-menu-item:hover {
  background: #f4f8fc;
}
.chat-v2 .chat-peer-list {
  padding: 0 12px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}
.chat-v2 .chat-peer-item {
  border-radius: 0;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid #d7dde6;
  overflow: hidden;
  min-height: 46px;
}
.chat-v2 .chat-composed-item.chat-peer-item {
  overflow: visible;
}
.chat-v2 .chat-peer-row {
  min-width: 0;
  gap: 6px;
}
.chat-v2 .chat-peer-main {
  min-width: 0;
  overflow: hidden;
}
.chat-v2 .chat-peer-list .chat-peer-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.2;
}
.chat-v2 .chat-peer-list .chat-peer-avatar {
  width: 26px;
  height: 26px;
}
.chat-v2 .chat-peer-list .chat-peer-login {
  margin-top: 1px;
  gap: 3px;
  font-size: 9px;
}
.chat-v2 .chat-peer-item.active {
  background: #e9f1ff;
  border-radius: 10px;
  border-bottom-color: transparent;
}
.chat-v2 .chat-peer-item.compose-selected {
  background: #eef4ff;
  border-color: #b9d3ff;
}
.chat-v2 .chat-peer-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
}
.chat-v2 .chat-peer-avatar-wrap.online {
  box-shadow: 0 0 0 3px #2f7dea;
}
.chat-v2 .chat-peer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.chat-v2 .chat-peer-online-dot {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d1d5db;
  border: 2px solid #fff;
}
.chat-v2 .chat-peer-online-dot.online {
  background: #16c784;
}
.chat-v2 .chat-peer-online-dot.offline {
  background: #d1d5db;
}
.chat-v2 .chat-peer-compose-check {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1f6fe5;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.chat-v2 .chat-peer-preview {
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.25;
  color: #465b72;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 66%;
}
.chat-v2 .chat-peer-blue-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f7dea;
  flex: 0 0 10px;
}
.chat-v2 .chat-peer-unread-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #2f7dea;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
}
.chat-v2 .chat-main-header {
  min-height: 48px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
}
.chat-v2 .chat-header-peer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.chat-v2 .chat-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-v2 .chat-header-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.chat-v2 .chat-header-name {
  font-size: 13px;
  line-height: 1.15;
  font-weight: 700;
  color: #101828;
}
.chat-v2 .chat-header-status {
  margin-top: 2px;
  font-size: 11px;
  color: #8a97a8;
}
.chat-v2 .chat-header-status.online {
  color: #1ea97c;
}
.chat-v2 .chat-header-actions {
  display: inline-flex;
  gap: 10px;
}
.chat-v2 .chat-header-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  display: inline-grid;
  place-items: center;
  background: #e8f0ff;
  color: #2372e5;
  padding: 0;
}
.chat-v2 .chat-header-action-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.chat-v2 .chat-header-action-btn:disabled {
  opacity: 0.45;
}
.chat-v2 .chat-messages {
  background: #fff;
  padding: 20px 22px;
}
.chat-v2 .chat-bubble-wrap {
  margin-bottom: 12px;
}
.chat-v2 .chat-bubble {
  border-radius: 12px;
  padding: 8px 10px 6px;
  box-shadow: none;
  border: 1px solid transparent;
}
.chat-v2 .chat-bubble-wrap:not(.mine) .chat-bubble {
  background: #eef1f4 !important;
  border-color: #d6dde5 !important;
  color: #1d2939 !important;
}
.chat-v2 .chat-bubble-wrap.mine .chat-bubble {
  background: #dff5df;
  border-color: #c6e8c6;
  color: #1d3b1d;
}
.chat-v2 .chat-bubble-wrap.mine .chat-message-text {
  color: #1d3b1d;
}
.chat-v2 .chat-bubble-wrap.mine .chat-reply-quote {
  background: rgba(82, 136, 82, 0.10);
  border-left-color: rgba(82, 136, 82, 0.55);
}
.chat-v2 .chat-bubble-wrap.mine .chat-reply-quote-label,
.chat-v2 .chat-bubble-wrap.mine .chat-reply-quote-body {
  color: #2d5a2d;
}
.chat-v2 .chat-bubble-foot {
  margin-top: 5px;
  gap: 6px;
}
.chat-v2 .chat-bubble .meta {
  font-size: 9px;
}
.chat-v2 .chat-bubble-wrap.mine .chat-bubble .meta {
  color: #4f6f4f;
}
.chat-v2 .chat-bubble-wrap:not(.mine) .chat-bubble .meta {
  color: #6b7788;
}
.chat-v2 .chat-status-check {
  color: #2f7bf0;
}
.chat-v2 .chat-input-area {
  background: #fff !important;
}
.chat-v2 .chat-input-row {
  grid-template-columns: auto 1fr auto auto;
}
.chat-v2 .chat-input-row textarea[name="body"] {
  border-radius: 14px;
}
@media (max-width: 900px) {
  .chat-layout.chat-v2 {
    grid-template-columns: 1fr;
    height: calc(100vh - 150px);
  }
  .chat-v2 .chat-sidebar-head {
    padding-left: 14px;
    padding-right: 14px;
  }
  .chat-v2 .chat-composed-group-list {
    margin-left: 14px;
    margin-right: 14px;
  }
  .chat-v2 .chat-sidebar-title {
    font-size: 13px;
  }
  .chat-v2 .chat-main-header {
    min-height: 48px;
    padding: 5px 10px;
  }
  .chat-v2 .chat-header-name {
    font-size: 14px;
  }
  .chat-v2 .chat-sidebar {
    max-height: 190px;
    border-right: none;
    border-bottom: 1px solid #d5d2cd;
  }
  .chat-v2 .chat-messages {
    padding: 14px;
  }
  .chat-v2 .chat-bubble {
    max-width: 88%;
  }
  .chat-v2 .chat-input-row {
    grid-template-columns: auto 1fr auto auto;
  }
  .chat-v2 .chat-image {
    width: 100%;
  }
  .chat-v2 .chat-lightbox-prev {
    left: 10px;
  }
  .chat-v2 .chat-lightbox-next {
    right: 10px;
  }
}

body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2 {
  grid-template-columns: 1fr;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2 .chat-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  border-right: none;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2 .chat-peer-list {
  flex: 1;
  min-height: 0;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2:not(.chat-mobile-thread-active) .chat-main {
  display: none;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-thread-active .chat-sidebar {
  display: none;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-thread-active .chat-main {
  display: flex;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-sidebar {
  background: #fff;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-sidebar-head {
  padding: 16px 18px 12px;
  border-bottom: 0;
  background: #fff;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-group-list {
  margin: 0 18px 4px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-content: flex-start;
  padding: 0 18px 14px;
  background: #fff;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-item,
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-item.chat-peer-item {
  margin: 0;
  padding: 10px 0;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid #e6ebf1;
  border-radius: 0;
  background: transparent;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-item:hover,
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-item:hover {
  background: transparent;
  border-color: #e6ebf1;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-item.active,
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-item.active {
  background: rgba(47, 125, 234, 0.08);
  border-radius: 14px;
  border-bottom-color: transparent !important;
  padding-left: 10px;
  padding-right: 10px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-row,
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-item {
  gap: 10px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-row {
  align-items: flex-start;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-avatar-wrap {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-avatar {
  width: 42px;
  height: 42px;
  border-width: 1px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-online-dot {
  right: 2px;
  top: 2px;
  width: 10px;
  height: 10px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-compose-check {
  right: -2px;
  bottom: -1px;
  width: 14px;
  height: 14px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-main,
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-meta {
  padding-top: 1px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-top {
  gap: 6px;
  align-items: flex-start;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-name,
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-name {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-peer-preview,
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-sub {
  margin-top: 3px;
  max-width: none;
  font-size: 12px;
  line-height: 1.3;
  color: #6b7280;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-avatars {
  min-width: 42px;
  padding-left: 4px;
}
body.workspace-device-mode-mobile[data-page="chat"] .chat-layout.chat-v2.chat-mobile-list-active .chat-composed-avatar {
  width: 24px;
  height: 24px;
  margin-left: -7px;
}
