/* MEO v2 — フル幅・レスポンシブレイアウト */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

#root {
  width: 100%;
  min-height: 100vh;
}

.meo-app {
  width: 100%;
}

.meo-header {
  width: 100%;
  padding: 10px clamp(12px, 2vw, 24px) !important;
  text-align: left;
}

.meo-header-row {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  width: 100%;
  min-width: 0;
}

.meo-header-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.meo-header-meta {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 12px;
  color: #8c7f72;
  white-space: nowrap;
  flex-shrink: 0;
}

.meo-header-sync {
  flex-shrink: 0;
}

.meo-header-store {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
}

.meo-header-store .meo-store-select-row {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.meo-store-select-row--compact input[type='search'],
.meo-store-select-row--compact select {
  padding: 6px 8px;
  font-size: 12px;
}

.meo-store-select-row--compact button {
  padding: 6px 10px;
  font-size: 11px;
}

.meo-nav {
  flex-wrap: wrap;
  width: 100%;
  padding: 0 clamp(12px, 2.5vw, 48px) !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.meo-main {
  width: 100%;
  max-width: none;
  padding: clamp(12px, 1.5vw, 24px) clamp(16px, 2.5vw, 48px) !important;
}

.meo-container {
  width: 100%;
  max-width: none;
}

.meo-settings-layout,
.meo-post-card {
  width: 100%;
}

.meo-schedule-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: clamp(16px, 2vw, 28px);
  width: 100%;
}

.meo-schedule-calendar {
  min-width: 0;
}

.meo-calendar-grid {
  min-width: 0;
}

.meo-post-card-grid {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: clamp(16px, 2vw, 28px);
  width: 100%;
}

.meo-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 10px;
  width: 100%;
}

.meo-pattern-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  width: 100%;
}

@media (min-width: 1200px) {
  .meo-form-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .meo-post-card-grid {
    grid-template-columns: minmax(180px, 240px) 1fr;
  }
}

@media (min-width: 1600px) {
  .meo-form-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .meo-schedule-layout {
    grid-template-columns: 1fr minmax(300px, 380px);
  }

  .meo-calendar-grid .meo-calendar-day {
    min-height: 120px;
  }
}

.meo-calendar-grid {
  width: 100%;
}

.meo-calendar-day {
  min-height: 100px;
}

@media (min-width: 900px) {
  .meo-store-select-row {
    flex-wrap: nowrap !important;
  }
}

@media (max-width: 768px) {
  .meo-fixed-patterns-layout {
    grid-template-columns: 1fr !important;
  }

  .meo-header-row {
    flex-wrap: wrap;
  }

  .meo-header-store {
    flex-basis: 100%;
    margin-left: 0;
  }

  .meo-header-store .meo-store-select-row {
    justify-content: flex-start;
  }

  .meo-schedule-layout {
    grid-template-columns: 1fr;
  }

  .meo-post-card-grid {
    grid-template-columns: 1fr;
  }

  .meo-pattern-inputs {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .meo-nav button {
    flex: 1 1 auto;
    min-width: max-content;
  }
}

/* ===== 操作ヘルプ フローティングチャット ===== */
.meo-help-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  font-family: 'Zen Kaku Gothic New', sans-serif;
}

.meo-help-fab {
  border: 1px solid #C8BFB0;
  background: #8B6F47;
  color: #FAF5EF;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(44, 40, 37, 0.18);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.meo-help-fab:hover {
  transform: translateY(-1px);
  background: #7a6140;
}

.meo-help-fab.is-open {
  background: #5C4A36;
}

.meo-help-panel {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: min(380px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  background: #F7F4EF;
  border: 1px solid #C8BFB0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(44, 40, 37, 0.22);
  animation: meo-help-rise 0.2s ease;
}

@keyframes meo-help-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meo-help-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #EDE9E1;
  border-bottom: 1px solid #C8BFB0;
}

.meo-help-panel-head strong {
  display: block;
  font-size: 14px;
  color: #2C2825;
}

.meo-help-panel-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #8C7F72;
}

.meo-help-icon-btn {
  border: none;
  background: transparent;
  color: #5C4A36;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 6px;
}

.meo-help-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meo-help-bubble {
  max-width: 92%;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.meo-help-bubble--assistant {
  align-self: flex-start;
  background: #EDE9E1;
  color: #2C2825;
  border: 1px solid #D9D0C3;
}

.meo-help-bubble--user {
  align-self: flex-end;
  background: #8B6F47;
  color: #FAF5EF;
}

.meo-help-typing {
  opacity: 0.75;
  font-style: italic;
}

.meo-help-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}

.meo-help-chip {
  border: 1px solid #C8BFB0;
  background: #FAF8F4;
  color: #5C4A36;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

.meo-help-chip:hover:not(:disabled) {
  background: #EDE9E1;
}

.meo-help-chip:disabled {
  opacity: 0.55;
  cursor: wait;
}

.meo-help-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #E4DCD0;
  margin-top: 8px;
  background: #F7F4EF;
}

.meo-help-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #C8BFB0;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  background: #FAF8F4;
  color: #2C2825;
  font-family: inherit;
}

.meo-help-form button {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  background: #8B6F47;
  color: #FAF5EF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.meo-help-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .meo-help-chat {
    right: 12px;
    bottom: 12px;
  }

  .meo-help-panel {
    height: min(70vh, calc(100vh - 88px));
  }
}
