:root {
  --bg: #f5f6fa;
  --text: #121619;
  --surface: #ffffff;
  --border: #e6e8ee;
  --primary: rgb(23 37 84);
}

/* Base */
body {
  font-size: 0.9rem;
}

/* Mobileでのズーム防止: 入力要素を16px(1rem)以上に設定 */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 1rem !important;
  }
}

button,
input[type="submit"] {
  cursor: pointer;
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  -moz-appearance: textfield;
}

.htmx-indicator {
  display: none;
  position: fixed;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.htmx-request .htmx-indicator {
  display: block;
}

.htmx-request.htmx-indicator {
  display: block;
}

.spinner-container {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px #ddd solid;
  border-top: 4px #2e93e6 solid;
  border-radius: 50%;
  animation: sp-anime 0.8s infinite linear;
}

@keyframes sp-anime {
  100% {
    transform: rotate(360deg);
  }
}

.u-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
  "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.u-btn-primary {
  display: block;
  width: 16rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  height: 3rem;
  border-radius: 9999px;
  background-color: rgb(30 58 138);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.025em;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.u-btn-primary:hover {
  background-color: rgb(23 37 84);
}
.u-btn-primary:disabled {
  background-color: #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
}

.u-btn-outline {
  display: block;
  width: 16rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  height: 3rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #374151;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-align: center;
  line-height: 3rem;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.u-btn-outline:hover {
  background-color: #f9fafb;
}

/* Header */
.u-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 78px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.u-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 78px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 32px;
}
.u-logo img {
  height: 40px;
  display: block;
}
.u-global-nav {
  display: none;
  gap: 20px;
  align-items: center;
}
@media (min-width: 769px) {
  /* Desktop header nav appearance overrides Tailwind utilities */
  .u-global-nav {
    display: flex;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    flex-direction: row !important;
    align-items: center !important;
    z-index: auto !important;
  }
}
/* Mobile open state for global nav */
@media (max-width: 768px) {
  .u-global-nav.is-open { display: flex; }
}
.u-nav-link {
  color: #475569;
  text-decoration: none;
  font-size: 14px;
}
.u-nav-link:hover { text-decoration: underline; }

.u-header__icons { display: flex; align-items: center; gap: 10px; margin-left: auto; position: relative; }
.u-icon-btn {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 18px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
}
.u-icon-btn:hover { background: var(--bg); cursor: pointer; }

.u-icon-btn img {
  width: 20px;
  height: 20px;
  display: block;
}

/* Main container */
.u-main {
  max-width: 1080px;
  margin: 28px auto 40px;
  padding: 0 16px;
  flex: 1 0 auto;
}

body.u-body > main { flex: 1 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 1px rgba(16,24,40,0.02);
}
.card + .card { margin-top: 16px; }

/* Footer */
.u-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.u-footer__top {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.u-footer__logo img {
  height: 32px;
}
.u-footer__links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 979px) {
  .u-footer__links {
    order: 3;
  }
  .u-footer__nav {
    order: 2;
  }
  .u-footer__logo {
    order: 1;
  }
}
.u-footer__links-row {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
}
.u-footer__links-row a {
  color: #777;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.u-footer__links-row a:hover {
  text-decoration: underline;
}

.u-footer__nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.u-footer__nav-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.u-footer__nav-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.u-footer__nav-col a {
  color: #121619;
  text-decoration: none;
  font-size: 13px;
}
.u-footer__nav-col a:hover {
  text-decoration: underline;
}

.u-footer__company {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.u-footer__company-grid {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.u-footer__company-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #121619;
  font-size: 13px;
}
.u-footer__company-info dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.u-footer__company-info dt {
  display: inline;
  font-weight: 600;
}
.u-footer__company-info dd {
  display: inline;
  margin: 0;
}
.u-footer__association {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.u-footer__association-badge {
  height: 20px;
  width: auto;
  display: block;
}
.u-footer__copyright {
  color: #777;
  font-size: 12px;
}

.u-footer__note {
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
  text-align: center;
}

@media (min-width: 980px) {
  .u-footer__top {
    display: grid;
    grid-template-areas:
      "logo nav"
      "links nav";
    grid-template-columns: auto 1fr;
    column-gap: 24px;
    row-gap: 0;
    align-items: start;
  }
  .u-footer__logo {
    grid-area: logo;
  }
  .u-footer__links {
    grid-area: links;
  }
  .u-footer__nav {
    grid-area: nav;
    grid-template-columns: repeat(5, auto);
    gap: 32px;
  }
  .u-footer__company-grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
  .u-footer__company-info {
    flex-direction: row;
    gap: 32px;
  }
}


/* Hamburger (mobile only) aligned to right end */
.u-hamburger { display: grid; place-items: center; }
@media (min-width: 769px) {
  .u-hamburger { display: none; }
}

/* User dropdown menu */
.u-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 220px;
  z-index: 60;
  display: none;
  flex-direction: column;
}
.u-user-menu.is-open { display: flex; }
.u-user-menu__item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  text-align: left;
}
.u-user-menu__item:hover { background: var(--bg); cursor: pointer; }
.u-user-menu form { margin: 0; }
.u-user-menu form .u-user-menu__item { background: transparent; border: none; font: inherit; }
.u-user-menu form .u-user-menu__item:hover { background: var(--bg); }

/* Mobile menu close (X) button inside dropdown */
.u-menu-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  z-index: 60; /* above menu items */
}
@media (min-width: 769px) {
  .u-menu-close { display: none; }
}
