/* Aozora Booking — Figma 予約状況カード（node 7924:266）準拠 */
/* flex-direction: column / absolute は使わず、1fr auto 1fr で ab_wrapper 中央寄せ */

#app .ab_wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(12px, 0.7511737089vw + 9.1830985915px, 24px);
  row-gap: clamp(16px, 1.1267605634vw + 11.7746478873px, 28px);
  box-sizing: border-box;
  width: 100%;
  min-height: clamp(160px, 4.0164319249vw + 144.9295774648px, 203px);
  padding: clamp(20px, 0.7511737089vw + 17.1830985915px, 28px);
  background-color: #fff;
  border-radius: 8px;
  text-align: center;
}

/* バッジ「予約状況」— 左列・コンテンツ幅のみ（ピンクが伸びない） */
#app .ab_wrapper .sub-title {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: #e8336e;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  user-select: none;
  min-height: 28px;
}

#app .ab_wrapper .sub-title .ab_clear_token_link {
  margin-left: 0.5em;
  color: #fff;
  text-decoration: underline;
}

/* form 内ラッパーは grid に参加させ、子を直接配置 */
#app .ab_wrapper > form,
#app .ab_wrapper .ab_form,
#app .ab_wrapper .ab_container {
  display: contents;
}

/* 日付エリア — 中央列（左右 1fr で ab_wrapper 基準の中央） */
#app .ab_wrapper .ab_row:has(.ab_status) {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 0;
}

/* ボタン行 — 全列にまたがり中央 */
#app .ab_wrapper .ab_row:has(.ab_button) {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 0;
  gap: 10px clamp(16px, 0.7511737089vw + 13.1830985915px, 24px);
}

#app .ab_wrapper .ab_row:has(.ab_button) > * {
  flex: none;
}

/* ステータス行 + 注記（Vue同梱の .ab_status / b 色を上書き） */
#app .ab_wrapper .ab_status {
  display: grid;
  justify-items: center;
  row-gap: clamp(12px, 0.5633802817vw + 9.8873239437px, 18px);
  border: none;
  padding: 0;
  color: #000;
  font-weight: 700;
  text-align: center;
  vertical-align: baseline;
  margin-top: calc(14px + ((1em - 1lh) / 2));
}

#app .ab_wrapper .ab_status b,
#app .ab_wrapper .ab_status .ab_num {
  color: #000;
  margin: 0;
}

#app .ab_wrapper .ab_status_line {
  display: block;
  letter-spacing: 0.125em;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: #000;
  margin-block: calc((1em - 1lh) / 2);
}

#app .ab_wrapper .ab_status .ab_num {
  display: inline-block;
  font-size: clamp(28px, 1.8779342723vw + 20.9577464789px, 48px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.125em;
  margin-block: calc((1em - 1lh) / 2);
}

#app .ab_wrapper .ab_status_note {
  display: block;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: #000;
  margin-block: calc((1em - 1lh) / 2);
}

#app .ab_wrapper .ab_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 176px;
  min-height: 44px;
  padding: 10px 24px;
  border: none;
  border-radius: 50vw;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

#app .ab_wrapper .ab_button_large {
  font-size: 16px;
}

#app .ab_wrapper .ab_accept_button {
  background-color: #e8336e;
}

#app .ab_wrapper .ab_cancel_button {
  background-color: #969696;
}

#app .ab_wrapper .ab_button:disabled {
  background-color: #969696;
  opacity: 0.6;
  cursor: not-allowed;
}

/* 受付時間外：バッジ非表示・縦余白を詰めてメッセージのみ中央寄せ */
#app .ab_wrapper:has(> .ab_closed) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  row-gap: 0;
}

#app .ab_wrapper:has(> .ab_closed) .sub-title {
  display: none;
}

#app .ab_wrapper .ab_closed {
  margin: 0;
  padding: 0;
  font-weight: 700;
  text-align: center;
}

/* 管理者テーブル */
#app .ab_wrapper table {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
}

#app .ab_wrapper .ab_center {
  text-align: center;
}

/* モーダル：ボタン2つ分の min-width が収まる幅へ */
#app .ab_wrapper .ab_modal_container {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
}

#app .ab_wrapper .ab_modal_container .ab_buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#app .ab_wrapper .ab_modal_container .ab_button {
  flex: 1 1 140px;
  min-width: 140px;
}

/* タブレット〜狭い幅：3列だとバッジが潰れるので縦積み */
@media (width <= 1024px) {
  #app .ab_wrapper {
    grid-template-columns: 1fr;
  }

  #app .ab_wrapper .ab_status {
    margin-top: 0;
  }

  #app .ab_wrapper .sub-title {
    grid-column: 1;
    grid-row: 1;
  }

  #app .ab_wrapper .ab_row:has(.ab_status) {
    grid-column: 1;
    grid-row: 2;
  }

  #app .ab_wrapper .ab_row:has(.ab_button) {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (width <= 767px) {
  #app .ab_wrapper .ab_status_line {
    letter-spacing: 0.06em;
  }

  #app .ab_wrapper .ab_button {
    min-width: min(176px, 100%);
  }
}
