:root {
  --font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: var(--font-size);
  line-height: 1.5;
  background: #ffffff;
  color: #030213;
}

h1 {
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}

h4 {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}

p {
  margin: 0;
}

label {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

button {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  font-family: inherit;
}

a {
  color: inherit;
}

svg {
  flex-shrink: 0;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.hidden {
  display: none !important;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  height: 4rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
.app-header__inner {
  height: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.app-header__toggle {
  padding: 0.5rem;
  border: none;
  background: none;
  border-radius: 0.5rem;
  display: flex;
}
.app-header__toggle:hover {
  background: #e9ebef;
}
.app-header__user {
  font-size: 0.875rem;
  color: #717182;
}

.app-sidebar {
  position: fixed;
  left: 0;
  top: 4rem;
  bottom: 0;
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  z-index: 20;
  width: 16rem;
  overflow: hidden;
}
.app-sidebar--collapsed {
  width: 0;
  transform: translateX(-100%);
}
.app-sidebar__nav {
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.app-sidebar__items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: none;
  color: #030213;
  transition: background-color 0.15s;
  text-align: left;
}
.nav-item:hover {
  background: #e9ebef;
}
.nav-item--active {
  background: #030213;
  color: #ffffff;
}
.nav-item--active:hover {
  background: #030213;
}

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: none;
  color: #030213;
  margin-top: 1rem;
  transition: background-color 0.15s, color 0.15s;
}
.logout-btn:hover {
  background: #d4183d;
  color: #ffffff;
}

.app-main {
  padding-top: 4rem;
  transition: padding-left 0.3s;
  padding-left: 16rem;
}
.app-main--full {
  padding-left: 0;
}

.app-content {
  padding: 1.5rem;
}

.app-sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .app-header__inner {
    padding: 0 0.5rem;
  }
  .app-header__left {
    gap: 0.5rem;
  }
  .app-header__title {
    font-size: 1.125rem;
    white-space: nowrap;
  }
  .app-header__title-sub {
    display: none;
  }
  .app-header__user {
    display: none;
  }
  .app-sidebar {
    width: min(16rem, 80vw);
    transition: transform 0.3s;
    z-index: 30;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  }
  .app-sidebar--collapsed {
    width: min(16rem, 80vw);
    box-shadow: none;
  }
  .app-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 4rem 0 0 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 25;
    opacity: 1;
    transition: opacity 0.3s;
  }
  .app-sidebar--collapsed + .app-sidebar-backdrop {
    opacity: 0;
    pointer-events: none;
  }
  .app-main,
  .app-main--full {
    padding-left: 0;
  }
  .app-content {
    padding: 1rem;
  }
}
.icon {
  width: 1.25rem;
  height: 1.25rem;
}
.icon--sm {
  width: 1rem;
  height: 1rem;
}
.icon--md {
  width: 1.5rem;
  height: 1.5rem;
}
.icon--lg {
  width: 2rem;
  height: 2rem;
}

.page {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.page--narrow {
  max-width: 42rem;
}
.page--medium {
  max-width: 56rem;
}
.page--full {
  max-width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.page-header__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-header__title {
    white-space: nowrap;
  }
}

.back-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.icon-btn {
  padding: 0.5rem;
  border: none;
  background: none;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
}
.icon-btn:hover {
  background: #e9ebef;
}
.icon-btn--danger:hover {
  background: #fee2e2;
  color: #d4183d;
}

.card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.card--flush {
  padding: 0;
  overflow: hidden;
}
.card--clickable {
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.card--clickable:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hero-card {
  background: linear-gradient(to right, #030213, rgba(3, 2, 19, 0.8));
  color: #ffffff;
  border-radius: 0.75rem;
  padding: 2rem;
}
.hero-card h1 {
  margin-bottom: 0.5rem;
}
.hero-card p {
  opacity: 0.9;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-weight: 500;
  transition: opacity 0.15s, background-color 0.15s;
}
.btn--primary {
  background: #030213;
  color: #ffffff;
}
.btn--primary:hover {
  opacity: 0.9;
}
.btn--outline {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.1);
  color: #030213;
}
.btn--outline:hover {
  background: #e9ebef;
}
.btn--block {
  width: 100%;
}
.btn--lg {
  padding: 0.75rem 1.5rem;
}
.btn--sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn:disabled:hover {
  opacity: 0.4;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  padding: 0;
  color: #030213;
}
.btn-link:hover {
  text-decoration: underline;
}

.form-group {
  margin-bottom: 1.5rem;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.form-row:last-child {
  border-bottom: none;
}
.form-row > label {
  flex: 0 0 11rem;
  padding-top: 0.6rem;
  margin-bottom: 0;
  font-weight: 500;
}
.form-row > .form-row__control {
  flex: 1;
  min-width: 0;
}
.form-row .form-control,
.form-row select {
  width: 100%;
}

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
  }
  .form-row > label {
    flex-basis: auto;
    padding-top: 0;
  }
}
.tab-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  color: #717182;
  cursor: pointer;
}
.tab-btn:hover {
  color: #030213;
}
.tab-btn.active {
  color: #030213;
  border-bottom-color: #030213;
}

.design-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.design-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.15s;
}
.design-card:hover {
  border-color: #b5b5b5;
}
.design-card--selected {
  border-color: #030213;
  border-width: 2px;
}
.design-card__preview {
  position: relative;
  height: 140px;
  overflow: hidden;
  background: #ececf0;
}
.design-card__preview iframe {
  width: 600px;
  height: 640px;
  border: 0;
  transform: scale(0.233);
  transform-origin: top left;
  pointer-events: none;
}
.design-card__body {
  padding: 0.6rem 0.85rem;
}
.design-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.design-card__desc {
  display: block;
  font-size: 0.75rem;
  color: #717182;
  margin-top: 0.2rem;
}
.design-card__edit {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.design-card__edit:hover {
  background: #e9ebef;
}
.design-card--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 196px;
  border-style: dashed;
  color: #717182;
  font-size: 0.85rem;
  gap: 0.4rem;
}
.design-card--add:hover {
  color: #030213;
  border-color: #b5b5b5;
}
.design-card--add .design-card__plus {
  font-size: 1.75rem;
  line-height: 1;
}

.template-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.template-section__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.template-section__title {
  margin: 0;
  padding-left: 0.6rem;
  border-left: 4px solid #030213;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.template-section__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.template-section__toggle {
  font-size: 1rem;
  transition: transform 0.15s;
  transform: rotate(-90deg);
}
.template-section__toggle.is-open {
  transform: rotate(0deg);
}
.template-section .design-gallery {
  margin: 1rem 0 0;
}

.design-gallery--compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}
.design-gallery--compact .design-card__preview {
  height: 80px;
}
.design-gallery--compact .design-card__preview iframe {
  transform: scale(0.22);
}
.design-gallery--compact .design-card__body {
  padding: 0.4rem 0.6rem;
}
.design-gallery--compact .design-card__label {
  display: block;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.design-gallery--compact .design-card__desc {
  display: none;
}
.design-gallery--compact .design-card__edit {
  top: 4px;
  right: 4px;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.8rem;
}
.design-gallery--compact .design-card--add {
  min-height: 110px;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem;
}
.design-gallery--compact .design-card--add .design-card__plus {
  font-size: 1.25rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}

.modal-panel {
  background: #ffffff;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 44rem;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
.modal-panel--wide {
  max-width: 64rem;
}
.modal-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-panel__header h3 {
  margin: 0;
}
.modal-panel__footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem 1rem;
  background: #f3f3f5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  outline: none;
}
.form-control:focus {
  box-shadow: 0 0 0 2px #b5b5b5;
}
.form-control[readonly] {
  opacity: 0.7;
}

textarea.form-control {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 1rem;
}

.form-hint {
  background: rgba(236, 236, 240, 0.5);
  padding: 1rem;
  border-radius: 0.5rem;
}
.form-hint h4 {
  margin-bottom: 0.5rem;
}
.form-hint p {
  color: #717182;
  font-size: 0.875rem;
}
.form-hint__vars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  column-gap: 1.5rem;
}
/* 開閉できる「使用可能な変数」（見出し全体がボタン） */
.form-hint__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.form-hint--collapsible h4 {
  margin-bottom: 0;
}
.form-hint__body {
  margin-top: 0.5rem;
}
.form-hint__toggle {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: #717182;
}
.form-hint--collapsible {
  margin-bottom: 1rem;
}
.form-hint__note {
  margin: 0.75rem 0 0.25rem;
}
/* 設定画面の自己紹介文・署名（月例メール用・オリジナルメール用）の折り畳み。見出しは .form-hint__header を流用 */
.settings-fold {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
/* 「月例メール用」「オリジナルメール用」は、どちらの設定か一目で分かるよう大きめ・太字・アクセント色にする */
.settings-fold__header h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1d4ed8;
}
.settings-fold__header .form-hint__toggle {
  color: #1d4ed8;
}
.settings-fold__body {
  margin-top: 1rem;
}

/* 設定画面のメール配信設定（カードごとの折り畳み）。見出し（.card__header）をボタンにし、右端に開閉の矢印を置く */
.settings-card-fold__header {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.settings-card-fold__header[aria-expanded="false"] {
  margin-bottom: 0;
}
.settings-card-fold__toggle {
  margin-left: auto;
}

/* 設定画面の署名（項目ごとの入力欄とプレビュー） */
.signature-fields {
  margin-bottom: 1rem;
}
.signature-fields__title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.signature-fields__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: #717182;
}
.signature-fields__var {
  color: #717182;
  font-size: 0.75rem;
  font-weight: 400;
}
.signature-preview {
  margin-top: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(236, 236, 240, 0.3);
}
.signature-preview__title {
  font-size: 0.8125rem;
  color: #717182;
  margin-bottom: 0.5rem;
}
.signature-preview__value {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.signature-preview__value p {
  margin: 0;
}
.signature-preview__value p + p {
  margin-top: 0.5em;
}
.signature-preview__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: #717182;
}

@media (max-width: 768px) {
  .form-hint__vars {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}

.form-error {
  background: rgba(212, 24, 61, 0.08);
  color: #d4183d;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.checkbox-list--row {
  flex-direction: row;
  flex-wrap: wrap;
}
.checkbox-list--nowrap {
  flex-wrap: nowrap;
}
@media (max-width: 768px) {
  .checkbox-list--nowrap {
    flex-wrap: wrap;
  }
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s;
}
.checkbox-row:hover {
  background: #e9ebef;
}
.checkbox-row input {
  width: 1rem;
  height: 1rem;
}
@media (max-width: 768px) {
  .checkbox-row {
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
}
.badge--lead {
  background: #dbeafe;
  color: #1e40af;
}
.badge--existing {
  background: #dcfce7;
  color: #166534;
}
.badge--retry {
  background: #fef9c3;
  color: #854d0e;
}
.badge--keyman {
  background: #f3e8ff;
  color: #6b21a8;
}
.badge--tag {
  background: #f1f5f9;
  color: #475569;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .stat-grid > .card {
    padding: 1rem;
  }
  .stat-grid .stat-tile__icon-row {
    gap: 0.5rem;
  }
  .stat-grid .stat-tile__icon {
    padding: 0.5rem;
  }
}

.stat-tile__icon-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.stat-tile__icon {
  padding: 0.75rem;
  border-radius: 0.5rem;
  display: inline-flex;
}
.stat-tile__icon--blue {
  background: #dbeafe;
  color: #2563eb;
}
.stat-tile__icon--green {
  background: #dcfce7;
  color: #16a34a;
}
.stat-tile__icon--purple {
  background: #f3e8ff;
  color: #9333ea;
}
.stat-tile__icon--orange {
  background: #ffedd5;
  color: #ea580c;
}
.stat-tile__value {
  font-size: 1.875rem;
  font-weight: 700;
}
.stat-tile__label {
  font-size: 0.875rem;
  color: #717182;
}

.toast-container {
  position: fixed;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 3rem);
}

.toast {
  background: #ffffff;
  color: #030213;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #030213;
  font-size: 0.875rem;
  max-width: 24rem;
  animation: toast-in 0.2s ease-out;
}
.toast--success {
  border-left-color: #16a34a;
}
.toast--error {
  border-left-color: #d4183d;
}
.toast--leaving {
  animation: toast-out 0.2s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead {
  background: #ececf0;
}
.data-table th, .data-table td {
  padding: 0.75rem 1.5rem;
  text-align: left;
}
.data-table tbody tr {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  transition: background-color 0.15s;
}
.data-table tbody tr:hover {
  background: rgba(236, 236, 240, 0.3);
}
.data-table__cell-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #717182;
}
.data-table__cell-icon svg {
  color: #9ca3af;
}

.data-table__select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.data-table__select-all-label {
  display: none;
}

.data-table--stack td.data-table--stack__only {
  display: none;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll > .data-table th,
.table-scroll > .data-table td {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .data-table th, .data-table td {
    padding: 0.625rem 0.75rem;
  }
  .data-table--stack thead {
    display: none;
  }
  .data-table--stack tbody tr {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
  }
  .data-table--stack td {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
  }
  .data-table--stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 6.5em;
    color: #717182;
    font-size: 0.75rem;
    padding-top: 0.125rem;
  }
  .data-table--stack td.data-table--stack__head {
    order: -1;
    font-size: 1rem;
    font-weight: 600;
  }
  .data-table--stack td.data-table--stack__actions {
    justify-content: flex-end;
  }
  .data-table--stack td.data-table--stack__only {
    display: flex;
  }
  .data-table--stack.data-table--checkable thead {
    display: block;
  }
  .data-table--stack.data-table--checkable thead tr {
    display: block;
    padding: 0.75rem 1rem;
  }
  .data-table--stack.data-table--checkable thead th {
    display: none;
    padding: 0;
  }
  .data-table--stack.data-table--checkable thead th:first-child {
    display: block;
  }
  .data-table--stack.data-table--checkable .data-table__select-all-label {
    display: inline;
    font-size: 0.875rem;
    font-weight: normal;
  }
  .data-table--stack.data-table--checkable tbody tr {
    position: relative;
    padding-left: 2.75rem;
  }
  .data-table--stack.data-table--checkable td.data-table--stack__check {
    position: absolute;
    left: 1rem;
    top: 1rem;
    padding: 0;
  }
  .data-table--stack td.data-table--stack__hide {
    display: none;
  }
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}
.filter-bar .form-group {
  margin-bottom: 0;
  flex: 1 1 200px;
}
.filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  flex: 1 1 100%;
}

.list-summary {
  padding: 1rem 1.5rem 0.75rem;
  font-size: 0.875rem;
  color: #717182;
}
.list-summary strong {
  color: #030213;
  font-size: 1rem;
}
@media (max-width: 768px) {
  .list-summary {
    padding: 0.75rem 1rem 0.5rem;
  }
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  color: #717182;
}
.pagination-bar__info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pagination-bar__limit-select {
  width: 4.5rem;
}
.pagination-bar__controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: nowrap;
  flex: 1 1 0;
  min-width: 24rem;
  overflow: hidden;
}
.pagination-bar__controls > * {
  flex-shrink: 0;
}
.pagination-bar__controls > :first-child {
  margin-left: auto;
}
.pagination-bar__num[hidden] {
  display: none;
}
.pagination-bar__gap {
  padding: 0 0.125rem;
  color: #717182;
}
.pagination-bar__current {
  display: none;
}
@media (max-width: 768px) {
  .pagination-bar {
    padding: 0.75rem 1rem;
  }
  .pagination-bar__num {
    display: none;
  }
  .pagination-bar__current {
    display: inline;
    padding: 0 0.5rem;
  }
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-item {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
}
.list-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;
}
.list-item__title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.list-item__meta {
  font-size: 0.875rem;
  color: #717182;
  white-space: nowrap;
}
.list-item__stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}
.list-item__body {
  color: #717182;
}
.list-item__top--compact {
  margin-bottom: 0;
}
.list-item__title-clamp {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.list-item__side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}
.list-item__subrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  font-size: 0.875rem;
}

.sends-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  max-width: 28rem;
  padding: 1rem 1.5rem 0.5rem;
}
.sends-search .form-control {
  flex: 1;
  min-width: 0;
}
.sends-search .btn {
  flex: none;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  background: none;
  text-align: left;
  width: 100%;
  transition: background-color 0.15s;
}
.quick-action:hover {
  background: #e9ebef;
}
.quick-action__title {
  font-weight: 500;
}
.quick-action__desc {
  font-size: 0.75rem;
  color: #717182;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(236, 236, 240, 0.3);
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}
.auth-card__header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-card__header h1 {
  margin-bottom: 0.5rem;
}
.auth-card__header p {
  color: #717182;
}
.auth-card__footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #717182;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.two-col--3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.date-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.my-group-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.my-group-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.my-group-picker__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
}
.my-group-picker__remove:hover {
  opacity: 1;
}
.my-group-picker__add-wrap {
  position: relative;
}
.my-group-picker__add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  background: none;
  color: #717182;
  cursor: pointer;
}
.my-group-picker__add-btn:hover:not(:disabled) {
  background: #e9ebef;
}
.my-group-picker__add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.my-group-picker__menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 50;
  min-width: 10rem;
  max-height: 14rem;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 0.25rem;
}
.my-group-picker__menu.hidden {
  display: none;
}
.my-group-picker__menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.my-group-picker__menu-item:hover {
  background: #e9ebef;
}
.my-group-picker__menu-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #717182;
}

.settings-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 64rem) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.settings-btn {
  min-width: 13rem;
  align-self: flex-start;
}

.card__header-action {
  margin-left: auto;
}

.news-list {
  display: flex;
  flex-direction: column;
}

.news-list__empty {
  color: #717182;
}

.news-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
  padding: 0.625rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.news-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.news-row:last-child {
  padding-bottom: 0;
}

.news-row__date {
  flex: none;
  font-size: 0.8125rem;
  color: #717182;
  font-variant-numeric: tabular-nums;
}

.news-row__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-field {
  position: relative;
}

.password-field > input {
  padding-right: 2.75rem;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: none;
  color: #717182;
  cursor: pointer;
}

.password-field__toggle:hover {
  color: #030213;
}

.password-field__toggle:focus-visible {
  outline: 2px solid #013048;
  outline-offset: 1px;
}

.news-title-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(3, 2, 19, 0.3);
  text-underline-offset: 3px;
}

.news-title-btn:hover {
  text-decoration-color: currentColor;
}

.news-popup__date {
  margin: -0.75rem 0 1rem;
  font-size: 0.8125rem;
  color: #717182;
}

.news-popup__body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
}

.news-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* 定型文（設定画面の一覧・フォーム、オリジナルメール作成画面の挿入） */
.snippet-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.snippet-list__empty {
  margin: 0;
  font-size: 0.875rem;
  color: #717182;
}
.snippet-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}
.snippet-item__body {
  flex: 1;
  min-width: 0;
}
.snippet-item__name {
  font-weight: 600;
  font-size: 0.875rem;
}
.snippet-item__content {
  font-size: 0.8125rem;
  color: #717182;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.snippet-item__actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}
.snippet-item__delete {
  color: #d4183d;
  border-color: #d4183d;
}
.snippet-form {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(236, 236, 240, 0.3);
}
.snippet-form__actions {
  display: flex;
  gap: 0.5rem;
}
.snippet-insert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.snippet-insert label {
  margin-bottom: 0;
}
.snippet-insert__controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.snippet-insert__controls select {
  width: auto;
  max-width: 16rem;
}
.form-control--sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}
