.archive-main {
  padding: 50px 12px 40px;
}

.archive-main h1 {
  margin: 2px;
  font-size: 20px;
  line-height: 1.2;
}

.archive-summary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 0px;
  margin-bottom: 0px;
  padding: 12px 10px 0px 4px;
}

.archive-profile {
  width: 52px;
  height: 52px;
  object-fit: cover;
  background: #eeeeee;
  border-radius: 50%;
}

.archive-summary-copy {
  display: flex;
  min-width: 0;
}

#profileName {
  margin: 0;
  color: var(--text);
  align-content: center;
  font-size: 16px;
}

.archive-summary-copy p {
  margin: 0;
  color: var(--sub-text);
  font-size: 12px;
}

#profileStatus {
  margin-left: auto;
  color: var(--sub-text);
  align-content: center;
  font-size: 12px;
}

.archive-summary-copy .archive-period {
  color: var(--text);
  font-size: 13px;
}

.archive-status {
  min-height: 40px;
  margin-bottom: 14px;
  padding: 10px 12px;
  color: var(--sub-text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
}

.archive-status[hidden] {
  display: none;
}

.year-section {
  margin-top: 18px;
}

.year-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 10px;
  color: var(--sub-text);
}

.year-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.year-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.month-card {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  color: var(--text);
  background: #eeeeee;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  isolation: isolate;
}

.month-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--month-image, none);
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
  transition: transform 160ms ease;
}

.month-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.6);
  transition: background 160ms ease;
}

.month-card:hover::before,
.month-card:focus-visible::before {
  transform: scale(1.07);
}

.month-card:hover::after,
.month-card:focus-visible::after {
  background: rgba(255, 255, 255, 0.5);
}

.month-card:focus-visible {
  outline: 3px solid rgba(239, 120, 151, 0.28);
  outline-offset: 2px;
}

.month-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 8px 4px;
  text-align: center;
}

.month-label {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.9);
}

.month-count {
  margin-top: 6px;
  color: #555555;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.9);
}

.empty-state {
  margin: 30px 0;
  padding: 24px 16px;
  color: var(--sub-text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  font-size: 14px;
}

.settings-modal[hidden] {
  display: none;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 0;
}

.settings-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding:
    8px
    18px
    max(24px, env(safe-area-inset-bottom));
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
  animation: settings-sheet-open 180ms ease-out;
}

.settings-sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 8px;
  background: #d8d8d8;
  border-radius: 999px;
}

.settings-sheet-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
}

.settings-sheet-header h2 {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font-size: 17px;
}

.settings-close-button {
  grid-column: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #555555;
  background: #f3f3f3;
  border: 0;
  border-radius: 50%;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.settings-label {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
}

.settings-input {
  width: 100%;
  height: 46px;
  margin-top: 9px;
  padding: 10px 13px;
  color: var(--text);
  background: #f8f8f8;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
}

.settings-description {
  margin: 8px 2px 0;
  color: var(--sub-text);
  font-size: 12px;
  line-height: 1.6;
}

.settings-error-message {
  min-height: 18px;
  margin: 7px 2px 0;
  color: #d94b64;
  font-size: 12px;
}

.settings-error-message:empty {
  display: none;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.settings-cancel-button,
.settings-save-button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.settings-cancel-button {
  color: #555555;
  background: #f2f2f2;
  border: 0;
}

.settings-save-button {
  color: #ffffff;
  background: var(--accent);
  border: 0;
}

body.settings-open {
  overflow: hidden;
}

@keyframes settings-sheet-open {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-sheet {
    animation: none;
  }
}

@media (max-width: 350px) {
  .archive-main {
    padding-inline: 9px;
  }

  .month-grid {
    gap: 7px;
  }

  .month-label {
    font-size: 18px;
  }
}

/* ヘッダー右側：案内・設定 */
.menu-page .header {
  grid-template-columns: minmax(0, 1fr) 84px;
}

.menu-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.menu-header-actions .icon-button {
  width: 42px;
  flex: 0 0 42px;
}

.info-icon { display: block; }

/* 案内ボトムシート（既存の設定シートのスタイルを継承） */
.info-sheet {
  max-height: min(85dvh, 720px);
  display: flex;
  flex-direction: column;
}

.info-sheet-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 12px;
}

.info-section {
  padding: 15px 2px;
}

.info-section + .info-section {
  border-top: 1px solid var(--border);
}

.info-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

.info-section p {
  margin: 0;
  color: #666;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.info-section p + p { margin-top: 8px; }

.info-section .info-contact-placeholder {
  color: #999;
  font-size: 12px;
}

.settings-sheet-header > .icon-button {
  grid-column: 3;
  justify-self: center;
}
