* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #231f1a;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

textarea,
select,
input[type="text"],
input[type="file"] {
  width: 100%;
}

#header{
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(201, 178, 157, 0.28);
}
#main-1{
  background: #fffaf5;
  padding: 30px 0;
}
#main-2{
  background: linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
  padding: 30px 0;
}
#main-3{
  background: linear-gradient(180deg, #e9f0eb 0%, #dbe6df 100%);
  padding: 30px 0;
}
.home-company-directory-section {
  padding-top: 8px;
  padding-bottom: 24px;
}
#footer{
  background: #f7f2ec;
  border-top: 1px solid rgba(201, 178, 157, 0.28);
  padding: 28px 0 32px;
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.site-footer-brand {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

.site-footer-brand-link {
  color: #51341b;
  text-decoration: none;
}

.site-footer-brand-link:hover {
  text-decoration: underline;
}

.site-footer-section-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8a7563;
  line-height: 1.5;
}

.site-footer-legal-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer-legal-item {
  font-size: 0.82rem;
  color: #6d5845;
  line-height: 1.5;
}

.site-footer-contact {
  margin: 0;
  font-size: 0.82rem;
  color: #6d5845;
  line-height: 1.5;
}

.site-footer-contact-link {
  color: inherit;
  text-decoration: none;
}

.site-footer-contact-link:hover {
  text-decoration: underline;
}

.site-footer-copyright {
  margin: 0;
  font-size: 0.78rem;
  color: #8a7563;
  line-height: 1.5;
}

.site-footer-legal-link {
  color: inherit;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.5;
}

.site-footer-legal-link:hover {
  text-decoration: underline;
}

.seo-noscript-fallback {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 0;
  color: #334155;
  line-height: 1.8;
}

.seo-noscript-fallback h1 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #2d241d;
  line-height: 1.4;
}

.seo-noscript-fallback p {
  margin: 0;
}

.legal-page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-page-shell #main-1 {
  flex: 1;
}

.legal-document {
  max-width: 860px;
  margin: 0 auto;
}

.legal-document-head {
  margin-bottom: 24px;
}

.legal-document-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 800;
  color: #2d241d;
  line-height: 1.4;
}

.legal-document-lead {
  margin: 0;
  color: #6d5845;
  font-size: 0.92rem;
}

.legal-document-intro {
  margin: 0 0 28px;
  line-height: 1.8;
  color: #334155;
}

.legal-section + .legal-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(201, 178, 157, 0.35);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #2d241d;
}

.legal-subheading {
  margin: 18px 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #51341b;
}

.legal-section p,
.legal-section li {
  line-height: 1.8;
  color: #334155;
}

.legal-ordered-list,
.legal-unordered-list {
  margin: 0;
  padding-left: 1.35rem;
}

.legal-ordered-list li + li,
.legal-unordered-list li + li {
  margin-top: 8px;
}

.legal-definition-list {
  margin: 0;
}

.legal-definition-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(201, 178, 157, 0.25);
}

.legal-definition-row:first-child {
  padding-top: 0;
}

.legal-definition-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.legal-definition-row dt {
  margin: 0;
  font-weight: 700;
  color: #51341b;
}

.legal-definition-row dd {
  margin: 0;
  color: #334155;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 12px 0 16px;
}

.legal-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.legal-table th,
.legal-table td {
  padding: 12px 14px;
  border: 1px solid rgba(201, 178, 157, 0.45);
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: rgba(247, 242, 236, 0.9);
  color: #51341b;
  font-weight: 700;
}

.legal-note {
  margin: 0;
  font-size: 0.88rem;
  color: #6d5845;
}

.guide-page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.guide-page-shell #main-1 {
  flex: 1;
}

.guide-page-shell .guide-company-directory-section {
  background: linear-gradient(180deg, #e9f0eb 0%, #dbe6df 100%);
  padding-top: 8px;
  padding-bottom: 24px;
}

.panel.guide-document {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid rgba(201, 178, 157, 0.35);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(73, 44, 20, 0.06);
  font-size: 1.1rem;
  line-height: 1.9;
}

.guide-document-head {
  margin-bottom: 20px;
}

.guide-eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7a4f2d;
}

.guide-eyebrow i {
  margin-right: 6px;
}

.guide-document-title {
  margin: 0 0 8px;
  font-size: 1.85rem;
  font-weight: 800;
  color: #2d241d;
  line-height: 1.35;
}

.guide-document-lead {
  margin: 0;
  color: #6d5845;
  font-size: 0.98rem;
}

.guide-document-intro {
  margin: 0 0 24px;
  color: #334155;
}

.guide-document-outro {
  margin: 16px 0 0;
  color: #334155;
}

.guide-toc {
  margin: 0 0 28px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(247, 242, 236, 0.85);
  border: 1px solid rgba(201, 178, 157, 0.35);
}

.guide-toc-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
  color: #51341b;
}

.guide-toc-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
}

.guide-toc-list a {
  color: #7a4f2d;
  text-decoration: none;
}

.guide-toc-list a:hover {
  text-decoration: underline;
}

.guide-section + .guide-section {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid rgba(201, 178, 157, 0.35);
}

.guide-section h2 {
  margin: 0 0 14px;
  font-size: 1.28rem;
  font-weight: 800;
  color: #2d241d;
}

.guide-section h3,
.guide-subsection-title {
  margin: 6px 0 10px;
  font-size: 1.02rem;
  font-weight: 800;
  color: #2d241d;
}

.guide-section p {
  margin: 0 0 14px;
  color: #334155;
}

.guide-figure {
  margin: 0 0 24px;
}

.guide-figure-compact {
  margin-bottom: 0;
}

.guide-illustration {
  display: block;
  width: 100%;
  height: auto;
}

.guide-illustration-compact {
  max-width: 280px;
}

.guide-figure-caption {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #6d5845;
  text-align: center;
}

.guide-photo {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(201, 178, 157, 0.45);
}

.guide-photo-figure {
  margin-bottom: 20px;
}

.guide-linkage-features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background: #faf6f1;
  border-radius: 16px;
}

.guide-linkage-features-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 18px;
  background: #fff;
  border: 1.5px solid #dcc7b3;
  border-radius: 12px;
  text-align: center;
}

.guide-linkage-features-icon-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-linkage-features-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.guide-linkage-features-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #efe4d8;
  font-size: 1.75rem;
  line-height: 1;
}

.guide-linkage-features-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2d241d;
  line-height: 1.4;
}

.guide-linkage-features-detail {
  margin: 0;
  font-size: 0.9rem;
  color: #6d5845;
  line-height: 1.5;
}

.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 30px;
}

.guide-card {
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(201, 178, 157, 0.4);
}

.guide-card-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  color: #2d241d;
}

.guide-card-title i {
  margin-right: 6px;
  color: #7a4f2d;
}

.guide-card-note {
  margin: 12px 0 0;
  font-size: 0.94rem;
  line-height: 1.7;
  color: #6d5845;
}

.guide-unordered-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
}

.guide-unordered-list li + li {
  margin-top: 6px;
}

.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: center;
}

.guide-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #334155;
}

.guide-checklist li + li {
  margin-top: 10px;
}

.guide-checklist i {
  margin-top: 3px;
  color: #7a4f2d;
  flex-shrink: 0;
}

.guide-table-wrap {
  overflow-x: auto;
  margin: 8px 0 20px;
}

.guide-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 1rem;
}

.guide-table-caption {
  margin: 0 0 10px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  color: #51341b;
}

.guide-table th,
.guide-table td {
  padding: 12px 14px;
  border: 1px solid rgba(201, 178, 157, 0.45);
  text-align: left;
  vertical-align: top;
}

.guide-table th {
  background: rgba(247, 242, 236, 0.9);
  color: #51341b;
  font-weight: 700;
}

.guide-callout {
  margin: 8px 0 20px;
  padding: 16px 18px;
  border-radius: 14px;
  line-height: 1.8;
}

.guide-callout-info {
  background: rgba(239, 246, 255, 0.75);
  border: 1px solid rgba(147, 197, 253, 0.45);
}

.guide-callout-warning {
  background: rgba(255, 247, 237, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.guide-callout-title {
  margin: 0 0 8px;
  font-weight: 800;
  color: #51341b;
}

.guide-callout p:last-child {
  margin-bottom: 0;
}

.guide-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.guide-step + .guide-step {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(201, 178, 157, 0.45);
}

.guide-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #7a4f2d;
  color: #fff;
  font-weight: 800;
}

.guide-step-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
  color: #2d241d;
}

.guide-step-body p {
  margin: 0;
}

.guide-summary-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
}

.guide-summary-list li + li {
  margin-top: 8px;
}

.guide-cta {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 8px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(247, 242, 236, 0.95), rgba(239, 228, 216, 0.95));
  border: 1px solid rgba(201, 178, 157, 0.45);
}

.guide-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #7a4f2d;
  color: #fff;
  font-size: 1.8rem;
}

.guide-cta-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #2d241d;
}

.guide-cta-text {
  margin: 0 0 14px;
  line-height: 1.8;
  color: #334155;
}

.guide-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #7a4f2d;
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.guide-cta-button:hover {
  background: #65401f;
}

.guide-inline-link {
  color: #7a4f2d;
  font-weight: 700;
  text-decoration: none;
}

.guide-inline-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .guide-card-grid {
    grid-template-columns: 1fr;
  }

  .guide-split {
    grid-template-columns: 1fr;
  }

  .guide-illustration-compact {
    max-width: none;
  }

  .guide-cta {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .guide-cta-icon {
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .guide-linkage-features-grid {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 14px;
  }

  .guide-linkage-features-item {
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 18px 16px;
  }

  .guide-linkage-features-icon-cell {
    flex: 3;
    min-width: 0;
  }

  .guide-linkage-features-copy {
    flex: 7;
    min-width: 0;
    align-items: center;
    justify-content: center;
  }

  .legal-definition-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .legal-document-title {
    font-size: 1.45rem;
  }

  .guide-document-title {
    font-size: 1.45rem;
  }

  .panel.guide-document {
    padding: 20px 16px;
  }
}
#header-inner, #main-inner, .main-inner, #footer-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  min-width: 0;
}

.header-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}


.header-bar {
  position: relative;
  min-width: 0;
  padding: 0;
}

.header-bar::after {
  content: none;
}

.header-bar-image-link {
  display: block;
  text-decoration: none;
}

.header-bar picture {
  display: block;
  max-width: 100%;
}

.header-bar-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 24px;
}

.header-auth {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  align-self: start;
}

.header-auth.is-sticky {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 60;
}

.auth-actions,
.auth-session {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-loading-placeholder {
  width: 214px;
  min-height: 44px;
}

.auth-company-badge,
.auth-button {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
}

.auth-company-badge {
  border: 1px solid rgba(214, 198, 182, 0.92);
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
  box-shadow: 0 10px 22px rgba(81, 52, 27, 0.06);
}

.auth-company-name {
  color: #2d241d;
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-company-link {
  color: inherit;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.auth-company-link:hover {
  border-color: #c9b29d;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(81, 52, 27, 0.1);
  transform: translateY(-1px);
}

a.auth-app-manager-link {
  color: inherit;
  text-decoration: none;
}

.auth-app-manager-link-current {
  cursor: default;
  pointer-events: none;
  opacity: 0.92;
}

.app-manager-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-manager-intro-panel .app-manager-lead {
  margin: 12px 0 0;
}

.app-manager-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .app-manager-columns {
    grid-template-columns: 1fr;
  }
}

.app-manager-column-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #2d241d;
}

.app-manager-column-title .fa-regular,
.app-manager-column-title .fa-solid {
  color: #7d5e43;
}

.app-manager-column-desc {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: #6d5845;
  line-height: 1.5;
}

.app-manager-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(70vh, 720px);
  overflow: auto;
}

.app-manager-user-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(214, 198, 182, 0.85);
  background: rgba(255, 255, 255, 0.72);
}

.app-manager-user-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.app-manager-user-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.app-manager-user-usage {
  flex: 0 0 auto;
  text-align: right;
  min-width: 5.5rem;
}

.app-manager-user-usage-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #8a6a4d;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.app-manager-user-usage-value {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #2d241d;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.app-manager-user-primary {
  font-weight: 800;
  font-size: 0.98rem;
  color: #2d241d;
  line-height: 1.35;
  margin-bottom: 6px;
}

.app-manager-user-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.86rem;
  color: #5b4b3d;
}

.app-manager-user-email {
  word-break: break-all;
}

.app-manager-user-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(125, 94, 67, 0.12);
  color: #5c4330;
}

.app-manager-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(177, 58, 47, 0.12);
  color: #9a2f26;
}

.app-manager-user-badge-dummy {
  background: rgba(61, 105, 189, 0.12);
  color: #3156a4;
}

.app-manager-user-badge-incomplete {
  background: rgba(185, 122, 0, 0.14);
  color: #8a5b00;
}

.app-manager-user-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #8a6a4d;
}

.app-manager-user-sub-warning {
  color: #9a2f26;
  font-weight: 700;
}

.app-manager-remaining-adjust {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(214, 198, 182, 0.75);
}

.app-manager-remaining-adjust-summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a5a3f;
  user-select: none;
}

.app-manager-remaining-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.app-manager-remaining-field {
  display: grid;
  gap: 4px;
}

.app-manager-remaining-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a6a4d;
}

.app-manager-remaining-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(214, 198, 182, 0.95);
  font-size: 0.86rem;
}

.app-manager-remaining-submit {
  justify-self: start;
  font-size: 0.82rem;
  padding: 6px 12px;
}

.app-manager-remaining-msg {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.app-manager-remaining-msg[data-kind="success"] {
  color: #2f6b3f;
}

.app-manager-remaining-msg[data-kind="error"] {
  color: #9a2f26;
}

.app-manager-profile-edit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(214, 198, 182, 0.75);
}

.app-manager-profile-edit-summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a5a3f;
  user-select: none;
}

.app-manager-profile-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.app-manager-profile-grid {
  display: grid;
  gap: 8px;
}

.app-manager-service-region-editor {
  display: grid;
  gap: 10px;
}

.app-manager-profile-field {
  display: grid;
  gap: 4px;
}

.app-manager-profile-field-full {
  grid-column: 1 / -1;
}

.app-manager-profile-field .mypage-logo-upload,
.app-manager-profile-field .mypage-logo-upload-controls {
  width: 100%;
}

.app-manager-profile-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a6a4d;
}

.app-manager-profile-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(214, 198, 182, 0.95);
  font-size: 0.86rem;
  background: #fff;
  color: #2d241d;
}

.app-manager-profile-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

.app-manager-profile-help {
  font-size: 0.7rem;
  color: #8a6a4d;
}

.app-manager-profile-submit {
  justify-self: start;
  font-size: 0.82rem;
  padding: 6px 12px;
}

.app-manager-profile-msg {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.app-manager-profile-msg[data-kind="success"] {
  color: #2f6b3f;
}

.app-manager-profile-msg[data-kind="error"] {
  color: #9a2f26;
}

.app-manager-account-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(214, 198, 182, 0.75);
}

.app-manager-account-actions-summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a5a3f;
  user-select: none;
}

.app-manager-account-actions-body {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.app-manager-account-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-manager-account-action-btn {
  font-size: 0.82rem;
  padding: 6px 12px;
}

.app-manager-account-actions-note {
  margin: 0;
  font-size: 0.78rem;
  color: #8a6a4d;
}

.app-manager-account-actions-msg {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.app-manager-account-actions-msg[data-kind="success"] {
  color: #2f6b3f;
}

.app-manager-account-actions-msg[data-kind="error"] {
  color: #9a2f26;
}

.app-manager-user-status-suspended {
  background: rgba(154, 47, 38, 0.12);
  color: #9a2f26;
}

.app-manager-user-empty {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(214, 198, 182, 0.9);
  color: #6d5845;
  font-size: 0.9rem;
  text-align: center;
}

@media (min-width: 720px) {
  .app-manager-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.auth-button {
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.button-icon,
.field-icon,
.section-title-icon,
.company-label-icon,
.company-inline-icon {
  flex: 0 0 auto;
}

.button-icon {
  margin-right: 8px;
}

.field-icon,
.company-label-icon,
.company-inline-icon {
  margin-right: 8px;
}

.section-title-icon {
  margin-right: 10px;
}

.to-manager-page-button {
  margin-right: 0;
}

.header-manager-link {
  justify-content: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}

.header-manager-link .button-icon,
.header-manager-link .to-manager-page-button {
  margin-right: 0;
}

.header-manager-link i {
  font-size: 1.1rem;
  line-height: 1;
}

.auth-button:hover {
  transform: translateY(-1px);
}

.auth-button:disabled,
.auth-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.15);
}

.auth-button-primary:disabled {
  background: linear-gradient(135deg, #b19a86 0%, #8f7967 100%);
  color: rgba(255, 255, 255, 0.92);
}

.auth-button-primary {
  background: linear-gradient(135deg, #6d4a2c 0%, #51341b 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(81, 52, 27, 0.16);
}

.auth-button-secondary {
  border: 1px solid rgba(214, 198, 182, 0.92);
  background: rgba(255, 255, 255, 0.84);
  color: #51341b;
  box-shadow: 0 10px 22px rgba(81, 52, 27, 0.05);
}

.auth-button-danger {
  background: #b13a2f;
  color: #fff;
  box-shadow: 0 8px 18px rgba(177, 58, 47, 0.16);
}

.auth-button-danger:hover:not(:disabled) {
  background: #962f25;
  box-shadow: 0 10px 22px rgba(177, 58, 47, 0.22);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  /* padding: 6px 12px; */
  /* border: 1px solid rgba(205, 185, 165, 0.78); */
  /* border-radius: 999px; */
  /* background: rgba(255, 255, 255, 0.72); */
  color: #7d5e43;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero {
  max-width: 760px;
}

.hero h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #2b221b;
  text-wrap: balance;
}

.site-title-link {
  color: inherit;
  text-decoration: none;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.site-title-link:hover {
  color: #51341b;
}

.mypage-stack {
  display: grid;
  gap: 20px;
}

.mypage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.mypage-customer-linkage-apply-root,
.mypage-customer-linkage-dashboard-root {
  margin-top: 12px;
  min-width: 0;
}

.mypage-customer-linkage-apply-root .company-card,
.mypage-customer-linkage-dashboard-root .company-card {
  margin: 0;
}

.mypage-grid-side-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.mypage-grid-side-stack .mypage-card {
  margin: 0;
}

.mypage-customer-linkage-apply-root {
  /* margin-top: 28px; */
  min-width: 0;
}

.mypage-customer-linkage-apply-root .company-card {
  margin: 0;
}

.mypage-kicker {
  margin: 0 0 8px;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mypage-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.mypage-logo-upload-row .mypage-detail-label {
  align-self: start;
}

.mypage-logo-upload {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mypage-logo-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.mypage-logo-upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.mypage-logo-remove-button {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: #8a6a4d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mypage-logo-remove-button:hover {
  color: #5c4637;
}

.mypage-file-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 10px 12px;
}

.mypage-logo-file-input {
  flex: 1 1 160px;
  max-width: 100%;
}

img.mypage-logo-upload-preview {
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e6d9cd;
  background: transparent;
}

.mypage-logo-upload-preview-placeholder {
  box-sizing: border-box;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: rgba(109, 74, 44, 0.55);
  border-radius: 12px;
  border: 1px solid #e6d9cd;
  background: #f3e8dd;
}

.mypage-logo-upload-row .mypage-detail-label {
  align-self: start;
}

.mypage-logo-upload {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mypage-logo-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.mypage-logo-upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.mypage-logo-remove-button {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: #8a6a4d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mypage-logo-remove-button:hover {
  color: #5c4637;
}

.mypage-file-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 10px 12px;
}

.mypage-logo-file-input {
  flex: 1 1 160px;
  max-width: 100%;
}

.mypage-title.mypage-title-with-hero {
  display: flex;
  align-items: center;
}

.mypage-hero-title-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.mypage-hero-avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  flex-shrink: 0;
}

.mypage-hero-avatar-button:focus-visible {
  outline: 2px solid rgba(109, 74, 44, 0.55);
  outline-offset: 3px;
}

.mypage-hero-avatar-button:hover .mypage-hero-avatar,
.mypage-hero-avatar-button:hover .mypage-hero-fa-icon {
  filter: brightness(0.97);
}

.mypage-hero-avatar-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.mypage-hero-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e6d9cd;
  background: transparent;
}

.mypage-hero-fa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(230, 217, 205, 0.55);
  color: #6b5545;
  font-size: 1.35rem;
}

/* グローバル input[type="file"] { width:100% } より詳細度を上げて 1px を維持（横スクロール防止） */
input[type="file"].mypage-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mypage-hero-title-text {
  min-width: 0;
  line-height: 1.25;
}

.mypage-copy {
  margin: 0;
  color: #5b4b3d;
  line-height: 1.7;
}

.mypage-card h3,
.mypage-empty h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.mypage-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.mypage-card-head h3 {
  margin: 0;
}

.mypage-customer-card-section + .mypage-customer-card-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eee2d5;
}

.mypage-customer-card-heading {
  margin: 0 0 6px;
  color: #8a6a4d;
  font-weight: 800;
  font-size: 0.95rem;
}

/* トップページ（result-side）では「顧客カードのみ」を表示する */
.company-linked-customers-section--result-side .mypage-customer-card-section:first-child {
  display: none;
}

.company-linked-customers-section--result-side
  .mypage-customer-card-section:last-of-type
  .mypage-customer-card-heading {
  display: none;
}

.company-linked-customers-section--result-side .mypage-customer-card-section + .mypage-customer-card-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.mypage-customer-invite-section {
  display: grid;
}

.mypage-customer-invite-actions {
  display: grid;
  gap: 14px;
}

.mypage-customer-invite-issue-btn,
.mypage-usage-spot-button,
.mypage-usage-grant-request-button {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
}

.mypage-usage-spot-section {
  display: flex;
  justify-content: center;
}

.mypage-usage-spot-button,
.mypage-usage-grant-request-button,
.spot-purchase-pending-card-actions .auth-button span {
  white-space: nowrap;
}

.spot-purchase-pending-card {
  width: 100%;
  margin-inline: auto;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #dbe6df;
  background: #f4f7f5;
}

.spot-purchase-pending-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.spot-purchase-pending-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 1rem;
  color: #234434;
}

.spot-purchase-pending-card-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e6f0ea;
  color: #355a47;
  font-size: 0.78rem;
  font-weight: 600;
}

.spot-purchase-pending-card-details {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}

.spot-purchase-pending-card-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.spot-purchase-pending-card-row dt {
  margin: 0;
  color: #5d7467;
  font-size: 0.88rem;
}

.spot-purchase-pending-card-row dd {
  margin: 0;
  color: #234434;
  font-weight: 600;
  word-break: break-word;
}

.spot-purchase-pending-card-note {
  margin: 0 0 0.95rem;
  color: #5d7467;
  font-size: 0.88rem;
  line-height: 1.55;
}

.spot-purchase-pending-card-note-warning {
  color: #9a6700;
}

.spot-purchase-pending-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.mypage-customer-invite-message-text {
  width: 100%;
  min-height: 8.5em;
  resize: vertical;
  line-height: 1.55;
  white-space: pre-wrap;
}

.modal-actions.modal-actions-invite-issued {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions.modal-actions-invite-issued .auth-button-secondary {
  margin-right: auto;
}

.mypage-customer-invite-guide {
  padding: 14px 16px;
  border: 1px solid rgba(125, 94, 67, 0.2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: 0 8px 20px rgba(81, 52, 27, 0.05);
  display: grid;
  gap: 12px;
}

.mypage-customer-invite-note {
  margin: 0;
  color: #2d241d;
  font-size: 0.95rem;
  line-height: 1.65;
}

.mypage-customer-invite-steps-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #8a6a4d;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.mypage-customer-invite-steps-heading i {
  font-size: 0.95rem;
  color: #a67c52;
}

.mypage-customer-invite-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.mypage-customer-invite-step {
  display: grid;
  grid-template-columns: 28px 22px 1fr;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #eee2d5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.mypage-customer-invite-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d4a2c 0%, #51341b 100%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(81, 52, 27, 0.18);
}

.mypage-customer-invite-step-icon {
  justify-self: center;
  color: #a67c52;
  font-size: 0.95rem;
  line-height: 1;
}

.mypage-customer-invite-step-text {
  color: #2d241d;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.mypage-customer-invite-history {
  display: grid;
}

.mypage-customer-invite-history-note {
  margin-bottom: 6px;
  max-width: 52rem;
}

.mypage-customer-invite-history-grid {
  display: grid;
  gap: 12px;
}

.mypage-customer-invite-history-card {
  border: 1px solid #eee2d5;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fffdfa;
  display: grid;
  gap: 10px;
}

.mypage-customer-invite-history-url-row {
  min-width: 0;
}

.mypage-customer-invite-history-url-input {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 0.875rem;
  overflow-x: auto;
  white-space: nowrap;
  cursor: text;
}

.mypage-customer-invite-history-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #2d241d;
}

.mypage-customer-invite-history-meta-item {
  white-space: nowrap;
}

.mypage-customer-invite-history-meta-label {
  margin-right: 0.2em;
  color: #8a6a4d;
  font-weight: 700;
}

.mypage-customer-invite-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mypage-customer-invite-copy-btn {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 0.875rem;
}

.signup-invite-intro {
  border-color: rgba(125, 94, 67, 0.28);
  background: linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(255, 255, 255, 0.96));
}

.mypage-customer-card-grid {
  display: grid;
  gap: 12px;
}

.mypage-customer-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e6d9cd;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
}

.mypage-customer-card.is-pending {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border-color: rgba(229, 158, 49, 0.42);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.94));
}

.mypage-customer-card.is-pending .mypage-customer-card-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.mypage-customer-card-requested-at {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px 10px;
  width: 100%;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  color: #8a6a4d;
}

.mypage-customer-card-requested-at-label {
  flex: 0 0 auto;
  color: #a67c52;
}

.mypage-customer-card-requested-at time {
  font-weight: 800;
  color: #5b4b3d;
}

.mypage-customer-card-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.mypage-customer-card-text-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mypage-customer-card-text-stack .mypage-customer-card-meta {
  margin: 0;
}

.mypage-customer-card-name {
  margin: 0;
  color: #2d241d;
  font-weight: 800;
  line-height: 1.5;
  font-size: 1.1rem;
}

.mypage-customer-link-unlink-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}

.mypage-customer-link-unlink-btn i {
  font-size: 0.9rem;
  line-height: 1;
}

.mypage-customer-link-unlink-btn.auth-button-danger:hover {
  background: #962f25;
  box-shadow: 0 10px 22px rgba(177, 58, 47, 0.22);
}

.mypage-customer-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 2px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  color: #8a6a4d;
}

.mypage-customer-card-meta-label {
  flex: 0 0 auto;
  color: #a67c52;
}

.mypage-customer-card-meta-value {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 800;
  color: #5b4b3d;
  font-size: 1rem;
}

.mypage-customer-card-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mypage-customer-card-actions .auth-button {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.85rem;
}

.mypage-customer-card-actions .mypage-customer-link-unlink-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
}

.mypage-customer-grant-generation-btn {
  white-space: nowrap;
}

.mypage-customer-card-actions--dm-only {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

.mypage-customer-card-actions--dm-only .dm-btn-wrap {
  flex: 0 0 auto;
}

.mypage-grant-history-section {
  display: grid;
}

.company-linked-customers-section + .mypage-grant-history-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eee2d5;
}

.mypage-grant-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.mypage-grant-history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(245, 239, 232, 0.7);
}

.mypage-grant-history-time {
  color: #8a6a4d;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.mypage-grant-history-name {
  min-width: 0;
  font-weight: 800;
  color: #2d241d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mypage-grant-history-amount {
  color: #2f7a45;
  font-weight: 900;
  white-space: nowrap;
}

.mypage-grant-history-more-btn {
  display: block;
  margin: 10px auto 0;
  padding: 6px 16px;
  border: 1px solid #e6d9cd;
  border-radius: 999px;
  background: #fff;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mypage-grant-history-more-btn:hover:not(:disabled) {
  background: #f5efe8;
  color: #5b4b3d;
}

.mypage-grant-history-more-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 顧客カード メモ欄（表示時は左寄せ、編集時のみ全幅グリッド） */
.mypage-customer-card-memo {
  border-top: 0;
  padding-top: 0;
  min-width: 0;
}

.mypage-customer-card-memo:not(.is-editing) {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  column-gap: 8px;
  row-gap: 4px;
}

.mypage-customer-card-memo.is-editing {
  grid-column: 1 / -1;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: start;
}

.mypage-customer-card-memo-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #a67c52;
  flex: 0 0 auto;
}

.mypage-customer-card-memo.is-editing .mypage-customer-card-memo-label {
  grid-column: 1;
}

.mypage-customer-card-memo-label::after {
  content: ":";
  margin-left: 4px;
  color: #b08b66;
}

.mypage-customer-card-memo-edit-btn {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid #d6c6b4;
  border-radius: 6px;
  background: transparent;
  color: #7a5a3e;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

.mypage-customer-card-memo-edit-btn:hover {
  background: #f3e8dd;
}

.mypage-customer-card-memo.is-editing .mypage-customer-card-memo-edit-btn {
  grid-column: 3;
}

.mypage-customer-card-memo-save-btn {
  grid-column: 3;
  margin: 0;
  padding: 2px 10px;
  border: 1px solid #7a5a3e;
  border-radius: 6px;
  background: #7a5a3e;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

.mypage-customer-card-memo-save-btn:hover {
  background: #5c4330;
  border-color: #5c4330;
}

.mypage-customer-card-memo-save-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mypage-customer-card-memo-input {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #d6c6b4;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.88rem;
  color: #3a2c22;
  background: #fffaf5;
}

.mypage-customer-card-memo-input:focus {
  outline: 2px solid #a07850;
  outline-offset: 1px;
}

.mypage-customer-card-memo-text {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-size: 0.88rem;
  color: #5b4b3d;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.mypage-customer-card-memo.is-editing .mypage-customer-card-memo-text {
  grid-column: 2;
}

.mypage-customer-card-memo-error {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  color: #b53a2f;
}

.dm-btn-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  vertical-align: middle;
}

.dm-unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 1;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

.header-notification-root {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.customer-dm-btn,
.mypage-customer-dm-btn,
.header-customer-dm-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #d6c6b6;
  border-radius: 50%;
  background: #fff;
  color: #8a6a4d;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(45, 36, 29, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.customer-dm-btn i,
.mypage-customer-dm-btn i,
.header-customer-dm-btn i {
  font-size: 1.35rem;
  line-height: 1;
}

/* マイページ内は横のボタン（auth-button）と高さを揃える */
.mypage-stack .mypage-customer-dm-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.mypage-stack .mypage-customer-dm-btn i {
  font-size: 1.1rem;
}

.header-notification-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d6c6b6;
  border-radius: 999px;
  background: #fff;
  color: #8a6a4d;
  cursor: pointer;
}

.header-notification-btn:hover {
  background: #fff8ef;
  color: #51341b;
}

.header-notification-btn:focus-visible {
  outline: 2px solid #c84b3f;
  outline-offset: 2px;
}

.header-notification-panel {
  position: fixed;
  z-index: 70;
  display: none;
  max-width: 400px;
  overflow: hidden;
  border: 1px solid rgba(214, 198, 182, 0.95);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(81, 52, 27, 0.14);
}

.header-notification-panel.is-open {
  display: block;
}

.header-notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(232, 223, 212, 0.9);
  background: #fffaf5;
}

.header-notification-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #2d241d;
}

.header-notification-mark-all {
  border: 0;
  background: transparent;
  color: #7d5e43;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.header-notification-mark-all:hover {
  color: #51341b;
}

.header-notification-panel-body {
  max-height: min(360px, 50vh);
  overflow: auto;
}

.header-notification-status,
.header-notification-empty {
  margin: 0;
  padding: 16px 14px;
  color: #6f5f52;
  font-size: 0.9rem;
  line-height: 1.5;
}

.header-notification-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-notification-item-link {
  display: block;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 223, 212, 0.65);
  transition: background-color 0.15s ease;
}

.header-notification-item:last-child .header-notification-item-link {
  border-bottom: 0;
}

.header-notification-item-link:hover {
  background: #fff8ef;
}

.header-notification-item.is-unread .header-notification-item-link {
  background: rgba(255, 248, 239, 0.72);
}

.header-notification-item-time {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a7563;
}

.header-notification-item-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  color: #2d241d;
}

.customer-dm-btn:hover,
.mypage-customer-dm-btn:hover,
.header-customer-dm-btn:hover {
  background: #fff8ef;
  color: #51341b;
}

.company-directory-dm-btn:hover {
  background: #fff8ef;
  color: #51341b;
  transform: translateY(-1px);
}

.customer-dm-btn:focus-visible,
.mypage-customer-dm-btn:focus-visible,
.header-customer-dm-btn:focus-visible,
.company-directory-dm-btn:focus-visible {
  outline: 2px solid #c84b3f;
  outline-offset: 2px;
}

.customer-linkage-active-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.customer-linkage-active-head .company-head {
  flex: 1;
  min-width: 0;
}

.customer-linkage-active-head .customer-dm-btn,
.customer-linkage-active-head .customer-linkage-unlink-btn {
  flex: 0 0 auto;
  align-self: flex-start;
}

body.dm-dialog-open {
  overflow: hidden;
  overflow-x: clip;
}

.mypage-edit-button,
.payment-change-button,
.payment-delete-button,
.mypage-action-row .auth-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.mypage-edit-button .button-icon,
.payment-change-button .button-icon,
.payment-delete-button .button-icon,
.mypage-action-row .auth-button .button-icon {
  margin-right: 6px;
}
.payment-change-button,
.payment-delete-button {
  margin-bottom: 0;
}

.mypage-detail-list {
  display: grid;
  gap: 14px;
}

.mypage-detail-row {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee2d5;
}

.mypage-detail-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mypage-detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.mypage-detail-label {
  display: inline-flex;
  align-items: center;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.mypage-detail-value-with-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.mypage-detail-value-action {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.mypage-detail-value {
  color: #2d241d;
  line-height: 1.7;
  padding-left:10px;
  overflow-wrap: anywhere;
  min-width: 0;
}

.mypage-detail-logo-cell {
  display: flex;
  align-items: center;
  min-height: 56px;
}

.mypage-logo-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e6d9cd;
  background: transparent;
}

.mypage-detail-unset {
  color: #7a6554;
  font-size: 0.95rem;
}

.mypage-detail-logo-cell {
  display: flex;
  align-items: center;
  min-height: 56px;
}

.mypage-detail-unset {
  color: #7a6554;
  font-size: 0.95rem;
}

.mypage-linkage-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eee2d5;
  display: flex;
  justify-content: flex-end;
}

.mypage-linkage-action-button {
  width: auto;
  min-height: 32px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  justify-content: center;
}

.mypage-detail-input,
.mypage-detail-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d6c6b6;
  border-radius: 12px;
  background: #fff;
  color: #2d241d;
  font: inherit;
}

.mypage-detail-textarea {
  resize: vertical;
  line-height: 1.6;
}

.mypage-address-grid {
  display: grid;
  gap: 14px;
}

.mypage-address-grid-primary {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(140px, 0.9fr) minmax(140px, 1fr);
  align-items: start;
}

.mypage-address-field-municipality {
  grid-column: 1 / -1;
}

.mypage-address-grid-secondary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mypage-address-row {
  display: grid;
  gap: 6px;
}

.mypage-address-sub-label,
.mypage-field-help {
  color: #7b624d;
  font-size: 0.85rem;
}

.mypage-address-sub-label {
  font-weight: 700;
}

.mypage-field-help {
  margin: 0;
  line-height: 1.6;
}

.mypage-field-help.is-success {
  color: #0f766e;
}

.mypage-field-help.is-error {
  color: #c0392b;
}

/* 住所自動入力ボタンは廃止（郵便番号入力で自動検索） */
.mypage-postal-code-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mypage-region-editor-list {
  display: grid;
  gap: 10px;
}

.mypage-region-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  padding-left: 10px;
}

.mypage-region-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.15em;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #e6d9cd;
  border-radius: 999px;
  background: #fcf7f2;
  color: #5b4b3d;
  line-height: 1.6;
}

.mypage-region-editor-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #eee2d5;
  border-radius: 14px;
  background: #fcf7f2;
}

.mypage-region-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 115px) minmax(0, 1fr);
  gap: 10px 12px;
}

.mypage-region-add-row {
  justify-self: start;
}

.signup-region-remove-button {
  align-self: center;
}

.company-region-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.company-region-chip {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #e6d9cd;
  border-radius: 999px;
  background: #fcf7f2;
  color: #5b4b3d;
  line-height: 1.6;
}

.company-region-note {
  font-size: 0.8em;
}

.mypage-link-list,
.mypage-link-inputs {
  display: grid;
  gap: 10px;
}

.mypage-link-row,
.mypage-link-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.mypage-link-name {
  color: #8a6a4d;
  font-size: 0.85rem;
  font-weight: 700;
}

.mypage-link-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 40px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.mypage-link-badge i {
  font-size: 1.5rem;
}

.mypage-link-row .mypage-detail-value {
  min-width: 0;
  padding-left: 0;
}

.mypage-link-input-row .mypage-detail-input {
  min-width: 0;
}

.mypage-line-url-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
}

.mypage-line-url-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a6a4d;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.mypage-line-url-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
}

.mypage-line-url-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a6a4d;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.mypage-link-badge.is-line {
  background: #06c755;
}

.mypage-link-badge.is-instagram {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 52%, #8134af 100%);
}

.mypage-link-badge.is-x {
  background: #111111;
}

.mypage-link-badge.is-contact {
  background: #0f766e;
}

.mypage-history-list {
  display: grid;
  gap: 12px;
}

.mypage-usage-summary {
  display: grid;
  gap: 18px;
}

.mypage-usage-plan-note {
  margin: 0;
  color: #5b4b3d;
  line-height: 1.7;
}

.mypage-usage-chart-label {
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.mypage-usage-chart {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e6d9cd;
  border-radius: 14px;
  background: #fcf7f2;
}
.mypage-usage-carryover-note{
  margin: 0;
}

.mypage-usage-bar-wrap {
  display: grid;
  gap: 6px;
}

.mypage-usage-bar-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mypage-usage-bar-min,
.mypage-usage-bar-max {
  color: #8a6a4d;
  font-size: 0.85rem;
  font-weight: 700;
}

.mypage-usage-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mypage-usage-chart-value {
  color: #2d241d;
  font-size: 1.6rem;
}

.mypage-usage-total-note,
.mypage-usage-lock-explanation {
  margin: 0;
  color: #6d5845;
  line-height: 1.65;
  font-size: 0.9rem;
}

.mypage-usage-lock-explanation {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f3ede6;
  border: 1px solid #e6d9cd;
}

.mypage-usage-bar {
  position: relative;
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: #eadfd3;
  box-shadow: inset 0 1px 2px rgba(73, 44, 20, 0.08);
}

.mypage-usage-bar-split {
  display: flex;
}

.mypage-usage-bar-split > .mypage-usage-bar-remaining,
.mypage-usage-bar-split > .mypage-usage-bar-locked {
  min-width: 2px;
}

.mypage-usage-bar-remaining,
.mypage-usage-bar-used {
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.mypage-usage-bar-remaining {
  background: linear-gradient(90deg, #4a7c3f 0%, #6b9b5c 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.mypage-usage-bar-locked {
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #c8bdb0,
    #c8bdb0 4px,
    #b8aca0 4px,
    #b8aca0 8px
  );
  box-shadow: inset 0 0 0 1px rgba(73, 44, 20, 0.08);
}

.mypage-usage-bar-used {
  background: linear-gradient(90deg, #51341b 0%, #7b5735 100%);
}

.mypage-usage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mypage-usage-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6d5845;
  line-height: 1.6;
}

.mypage-usage-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.mypage-usage-dot.is-used {
  background: #51341b;
}

.mypage-usage-dot.is-remaining {
  background: linear-gradient(90deg, #4a7c3f 0%, #6b9b5c 100%);
}

.mypage-usage-dot.is-locked {
  background: repeating-linear-gradient(
    -45deg,
    #c8bdb0,
    #c8bdb0 2px,
    #b8aca0 2px,
    #b8aca0 4px
  );
}

.mypage-history-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #e6d9cd;
  border-radius: 14px;
  background: #fcf7f2;
}

.mypage-history-item strong {
  color: #2d241d;
}

.mypage-history-item span {
  color: #6d5845;
  line-height: 1.6;
}

.mypage-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.payment-section {
  display: grid;
  gap: 12px;
}

.payment-next-billing-notice {
  margin: 0;
  color: #2d241d;
  font-weight: 700;
}

.mypage-usage-refill-notice {
  margin: 0 0 10px;
  color: #2d241d;
}

.usage-section .mypage-usage-chart {
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fcf7f2 0%, #f7efe6 100%);
}

.payment-section-label {
  margin: 0;
  color: #8a6a4d;
  font-size: 0.95rem;
  font-weight: 700;
}

.mypage-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mypage-stat-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #e6d9cd;
  border-radius: 14px;
  background: #fcf7f2;
}

.mypage-stat-label {
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.mypage-stat-value {
  color: #2d241d;
  font-size: 1.3rem;
}

.mypage-menu-list {
  display: grid;
  gap: 12px;
}

.mypage-menu-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #dccbbb;
  border-radius: 14px;
  background: #fff;
  color: #2d241d;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.mypage-menu-item:hover {
  border-color: #c9b29d;
  box-shadow: 0 8px 18px rgba(81, 52, 27, 0.08);
  transform: translateY(-1px);
}

.mypage-menu-item span {
  color: #6d5845;
  line-height: 1.6;
}

.mypage-menu-item.is-disabled {
  background: #fcf7f2;
}

.mypage-menu-item.is-disabled:hover {
  border-color: #dccbbb;
  box-shadow: none;
  transform: none;
}

.mypage-note-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #e6d9cd;
  border-radius: 14px;
  background: #fcf7f2;
  margin: 0 20px;
}

.mypage-note-box.is-success {
  border-color: #cfe7d4;
  background: #f3fbf5;
}

.mypage-note-box.is-error {
  border-color: #f0c9c9;
  background: #fff4f4;
}

.mypage-note-box p,
.mypage-empty p {
  margin: 0;
  color: #5b4b3d;
  line-height: 1.7;
}

.mypage-empty {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.mypage-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f2e5d8;
  color: #7a5838;
  font-size: 0.85rem;
  font-weight: 700;
}

.mypage-status-badge.is-active {
  background: #e2f3e5;
  color: #2c6b3f;
}

.mypage-status-badge.is-pending {
  background: #fff0d8;
  color: #8b5a11;
}

.mypage-status-badge.is-rejected {
  background: #f5e5e5;
  color: #8a4545;
}

.workflow-stack {
  display: grid;
  gap: 20px;
}

.workflow-grid-row {
  display: grid;
  gap: 20px;
  align-items: start;
}

.workflow-grid-row--primary {
  grid-template-columns: minmax(0, 1fr);
}

.workflow-grid-row--dashboard {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1001px) {
  .workflow-grid-row--primary {
    grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
    gap: 20px;
  }

  .workflow-grid-row--primary > .workflow-section--result:only-child {
    grid-column: 1 / -1;
  }

  .workflow-grid-row--dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
  }
}

.workflow-section {
  display: grid;
  gap: 14px;
  margin: 0;
}

.workflow-section-heading {
  margin: 0;
}

.workflow-section--result .result-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.top-dashboard-panel {
  margin: 0;
}

.top-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: start;
}

.top-history-empty-copy {
  margin: 0 0 12px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #7a6554;
  line-height: 1.5;
}

.top-dashboard-col {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.top-usage-box {
  padding: 18px 20px;
  border: 1px solid #e8dfd4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(73, 44, 20, 0.06);
}

.top-dashboard-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-size: 1.15rem;
  color: #51341b;
}

.top-dashboard-heading-note {
  font-size: 0.88rem;
  font-weight: 600;
  color: #8a6a4d;
}

.top-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.top-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e6d9cd;
  border-radius: 14px;
  background: #fcf7f2;
}

.top-history-item-button-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.top-history-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.top-history-download-btn,
.top-history-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d6c6b6;
  border-radius: 50%;
  background: #fff;
  color: #8a6a4d;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(45, 36, 29, 0.08);
}

.top-history-download-btn:hover:not(:disabled),
.top-history-share-btn:hover:not(:disabled) {
  background: #fff8ef;
  color: #51341b;
}

.top-history-download-btn:disabled,
.top-history-share-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.top-history-download-btn:focus-visible,
.top-history-share-btn:focus-visible {
  outline: 2px solid #c84b3f;
  outline-offset: 2px;
}

.top-history-download-btn i,
.top-history-share-btn i {
  font-size: 1rem;
  line-height: 1;
}

.top-history-item-button-inner:hover {
  background: rgba(255, 255, 255, 0.55);
}

.top-history-item-button-inner:focus-visible {
  outline: 2px solid #8b5a2b;
  outline-offset: 2px;
}

.top-history-thumb-wrap {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d9cabc;
  background: #f0e8e0;
}

.top-history-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-history-thumb-fallback.top-history-thumb {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
}

.top-history-line {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: #3d342c;
  line-height: 1.55;
  word-break: break-word;
}

.top-history-line:last-child {
  margin-bottom: 0;
}

.top-history-line-color .top-history-color-value {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-history-line-notes {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #5b4b3d;
}

.top-history-line-datetime {
  font-weight: 700;
  color: #2d241d;
}

.top-history-label {
  flex: 0 0 auto;
  width: max-content;
  white-space: nowrap;
  font-weight: 800;
  font-size: 0.8rem;
  color: #8a6a4d;
}

.top-history-notes-text {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.top-history-color-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  vertical-align: middle;
}

.top-history-color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(45, 36, 29, 0.22);
  flex-shrink: 0;
}

.top-history-item.is-skeleton .top-history-line {
  min-height: 1em;
  background: linear-gradient(90deg, #ece4dc 0%, #f5f0eb 50%, #ece4dc 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: top-history-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes top-history-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.top-history-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e8ddd4 0%, #d4c4b6 100%);
  border: 1px solid #d9cabc;
}

.top-history-body {
  flex: 1;
  min-width: 0;
}

.top-dashboard-foot {
  margin: 0;
}

.top-dashboard-link {
  font-weight: 700;
  color: #8b5a2b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.top-dashboard-link:hover {
  color: #6d441f;
}

.top-usage-block {
  display: grid;
  gap: 12px;
}

.top-usage-lead {
  margin: 0;
  color: #5b4b3d;
  line-height: 1.65;
  font-size: 0.95rem;
}

.top-usage-bar {
  height: 10px;
  border-radius: 999px;
  background: #eee2d5;
  overflow: hidden;
}

.top-usage-bar-used {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9a882, #a67c52);
  min-width: 0;
}

.top-usage-legend {
  margin: 0;
  font-size: 0.88rem;
  color: #7a6554;
}

.top-account-extra-panel {
  margin: 0;
}

.top-account-extra-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #51341b;
}

.top-account-extra-copy {
  margin: 0 0 12px;
  color: #5b4b3d;
  line-height: 1.65;
  font-size: 0.95rem;
}

.top-account-extra-foot {
  margin: 0;
}

@media (max-width: 800px) {
  .top-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.result-side-loading-copy {
  margin: 0;
  color: #5b4b3d;
  line-height: 1.65;
}

.result-side-linked-copy {
  margin: 0 0 12px;
  line-height: 1.65;
}

.result-side-foot {
  margin: 0;
}

.result-side-mypage-link {
  text-align: right;
}

.result-side-mypage-link a {
  color: #2f7a45;
  font-weight: 800;
  text-decoration: none;
}

.result-side-mypage-link a:hover {
  text-decoration: underline;
}

.result-side-no-linkage-copy {
  margin: 0 0 16px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #5b4b3d;
  line-height: 1.65;
}

.result-side-linkage-notice .result-side-foot {
  margin-top: 12px;
}

.result-side-prefecture-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 20px 0 5px;
  min-width: 0;
}

.result-side-prefecture-label {
  flex: 0 0 auto;
  font-weight: 700;
  color: #51341b;
  font-size: 0.95rem;
}

.result-side-prefecture-select {
  flex: 0 0 auto;
  width: 120px;
  padding: 10px 12px;
  border: 1px solid #d6c6b6;
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
  color: #51341b;
}

.result-side-company-list {
  display: grid;
  gap: 10px;
}

.result-side-company-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-side-company-row .result-side-company-item {
  flex: 1 1 auto;
  min-width: 0;
}

.result-side-linkage-apply-error {
  margin: 0 0 10px;
  color: #b13a2f;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
}

.linkage-apply-btn {
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 3px;
  border: 1px solid #1d6b4a;
  border-radius: 8px;
  background: linear-gradient(180deg, #2fb27a 0%, #1a8c5c 100%);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(26, 140, 92, 0.32);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.linkage-apply-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 3px 9px rgba(26, 140, 92, 0.38);
}

.linkage-apply-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 他社の申請が保留中のため出せない行（申請中の行は「申請中」リンクのため非表示） */
.linkage-apply-btn.is-pending-suppressed:disabled {
  opacity: 0.35;
  filter: grayscale(0.35);
  border-color: #9db0a4;
  background: linear-gradient(180deg, #a8c4b4 0%, #8aa89a 100%);
  color: rgba(255, 255, 255, 0.88);
}

.linkage-apply-btn-line {
  display: block;
  line-height: 1.05;
}

.result-side-company-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-side-company-row .result-side-company-item {
  flex: 1 1 auto;
  min-width: 0;
}

.result-side-linkage-apply-error {
  margin: 0 0 10px;
  color: #b13a2f;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
}

.linkage-apply-btn {
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0 3px;
  border: 1px solid #1d6b4a;
  border-radius: 8px;
  background: linear-gradient(180deg, #2fb27a 0%, #1a8c5c 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(26, 140, 92, 0.32);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.linkage-apply-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 3px 9px rgba(26, 140, 92, 0.38);
}

.linkage-apply-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 他社の申請が保留中のため出せない行（申請中の行は「申請中」リンクのため非表示） */
.linkage-apply-btn.is-pending-suppressed:disabled {
  opacity: 0.35;
  filter: grayscale(0.35);
  border-color: #9db0a4;
  background: linear-gradient(180deg, #a8c4b4 0%, #8aa89a 100%);
  color: rgba(255, 255, 255, 0.88);
}

.linkage-apply-btn-line {
  display: block;
  line-height: 1.5;
}

.linkage-pending-btn {
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0 3px;
  border: 1px solid #e8b4b4;
  border-radius: 8px;
  background: linear-gradient(180deg, #fde8e8 0%, #f5d0d0 100%);
  color: #a53c3c;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  box-shadow: 0 1px 4px rgba(165, 60, 60, 0.18);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.linkage-pending-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(165, 60, 60, 0.22);
}

.linkage-pending-btn:disabled {
  cursor: default;
  opacity: 0.7;
  transform: none;
  box-shadow: 0 1px 4px rgba(165, 60, 60, 0.12);
}

.result-side-company-empty {
  color: #5b4b3d;
  line-height: 1.65;
  margin: 0;
}

.result-side-company-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e6d9cd;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
}

.result-side-company-item:hover {
  border-color: #d6c6b6;
}

.result-side-company-logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3e8dd;
  border: 1px solid #decfbe;
  color: #8a6a4d;
  overflow: hidden;
}

.result-side-company-logo:has(.result-side-company-logo-image) {
  background: transparent;
}

.result-side-company-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}

.result-side-company-logo-fallback-icon {
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.9;
}

.result-side-company-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.result-side-company-name {
  font-weight: 800;
  color: #51341b;
  line-height: 1.35;
}

.result-side-company-meta {
  font-size: 0.75rem;
  color: #7a6554;
  line-height: 1.35;
}

.input-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 20px;
  /* border: 1px solid #d9cabc; */
  border-radius: 18px;
  /* background: #fffaf5; */
  /* box-shadow: 0 10px 30px rgba(73, 44, 20, 0.08); */
}

.panel h2 {
  margin-top: 0;
  /* margin-bottom: 16px; */
}

.field,
.field-group {
  display: grid;
  /* gap: 10px; */
  margin-bottom: 30px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 18px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="file"],
.field select,
.field textarea {
  padding: 12px 14px;
  border: 1px solid #d6c6b6;
  border-radius: 12px;
  background: #fff;
}

.field-help {
  margin: 0;
  color: #6d5845;
  line-height: 1.6;
}

.color-mode-field {
  margin-bottom: 10px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid #decfbe;
  border-radius: 16px;
  background: #f3e8dd;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
  color: #6a5542;
  font-size: 1rem;
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.mode-tab span {
  font-size: inherit;
  margin: 0;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.45);
}

.mode-tab.active {
  background: #fffaf5;
  color: #51341b;
  box-shadow: 0 8px 18px rgba(81, 52, 27, 0.1);
}

.tab-panel {
  padding: 16px;
  border: 1px solid #e1d3c5;
  border-radius: 16px;
  background: #fcfcf8;
}

.field textarea {
  resize: vertical;
  line-height: 1.6;
}

.color-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: stretch;
}

.color-row input[type="color"] {
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #d6c6b6;
  border-radius: 999px;
  background: #fff;
  justify-self: center;
  align-self: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.color-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-row input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

.color-row input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 999px;
}

.field-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

#color-mode-manufacturer .field{
  margin-bottom: 10px;
}

.image-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  overflow: hidden;
  border: 1px dashed #cdb7a2;
  border-radius: 16px;
  background: #f8f1ea;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.image-frame.is-drag-active {
  border-color: #8d5f34;
  background: #f1e4d5;
  box-shadow: inset 0 0 0 1px #8d5f34;
}

.image-frame.large {
  min-height: 420px;
}

.preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  padding: 24px;
  text-align: center;
  line-height: 1.7;
  color: #7b6a5a;
}

.image-loading {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(81, 52, 27, 0.16);
  border-top-color: #51341b;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.image-loading-text {
  margin: 0;
  color: #6d5845;
  line-height: 1.6;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.selected-paint-card {
  padding: 14px;
  border: 1px solid #dccbbb;
  border-radius: 14px;
  background: #fff;
}

.selected-paint-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.selected-paint-head-main {
  flex: 1 1 auto;
  min-width: 0;
}

.selected-paint-head-main strong {
  display: block;
  line-height: 1.35;
}

.selected-paint-subrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-top: 4px;
  color: #6d5845;
  font-size: 0.92rem;
  line-height: 1.55;
}

.selected-paint-code,
.selected-paint-hex {
  margin: 0;
  white-space: nowrap;
}

.paint-swatch {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

.paint-catalog {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.paint-catalog-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: #2f2f2f;
}

.paint-catalog-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.paint-catalog-item {
  display: grid;
  gap: 6px;
  padding: 5px;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  margin:3px;
}

.paint-catalog-item:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.paint-catalog-item.active {
  border-color: rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

span.paint-catalog-swatch {
  width: 100%;
  aspect-ratio: 1 / 0.6;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  margin:0;
}

.paint-catalog-code {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #1f2937;
  text-align: center;
  line-height: 1.15;
  word-break: break-word;
  margin-bottom:5px;
}

.chip-row,
.button-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.chip,
.secondary,
.ghost {
  padding: 10px 14px;
  border-radius: 999px;
  background: #efe4d8;
  color: #4b3827;
}

.ghost {
  background: transparent;
  outline: 1px solid #d6c6b6;
}

.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 320px);
  width: min(100%, 320px);
  padding: 16px 24px;
  border-radius: 12px;
  background: #51341b;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(81, 52, 27, 0.18);
  transition:
    background-color 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.actions {
  justify-content: center;
}

.result-actions-panel {
  display: grid;
  gap: 14px;
}

.result-disclaimer {
  margin: 0;
  color: #7b624d;
  font-size: 0.8rem;
  line-height: 1.7;
  text-align: left;
}

.result-actions-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result-action-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  text-align: center;
  white-space: normal;
  line-height: 1.45;
}

.result-action-button .button-icon {
  margin-right: 5px;
}

.result-share-modal-body {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.result-share-modal-thumb {
  display: block;
  width: min(100%, 280px);
  max-height: 180px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid #e8dfd4;
  background: #f3ebe2;
}

.result-share-modal-copy {
  margin: 0;
  text-align: center;
}

.result-share-modal-error {
  margin: 0;
  text-align: center;
}

.result-share-modal-hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #7a6554;
}

.result-share-modal-field {
  width: min(100%, 320px);
  display: grid;
  gap: 8px;
  justify-self: stretch;
}

.result-share-modal-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #51341b;
}

.result-share-modal-required {
  color: #b42318;
}

.result-share-modal-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e8dfd4;
  background: #fff;
  color: #3a2a1d;
  font: inherit;
}

@media (max-width: 800px) {
  .result-actions-buttons {
    grid-template-columns: 1fr;
  }
}

.result-layout {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 20px;
  align-items: start;
}

.result-main,
.result-side {
  min-width: 0;
}

.result-side {
  display: grid;
  gap: 14px;
}

/* .company-directory-main-inner {
  width: 100%;
  max-width: none;
  margin: 0;
} */

.company-directory-section {
  padding: 0 20px;
}

.company-directory-header {
  margin-bottom: 8px;
}

.company-directory-header h2 {
  margin: 0;
}

.company-directory-copy {
  margin: 0 0 16px;
  color: #5b4b3d;
  line-height: 1.7;
}

.company-directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.company-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.signup-panel {
  display: grid;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
}

.signup-kicker {
  margin: 0;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signup-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: #2d241d;
}

.signup-hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid rgba(186, 156, 128, 0.3);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(198, 160, 127, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 248, 241, 0.92));
  box-shadow: 0 18px 40px rgba(81, 52, 27, 0.06);
}

.signup-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7b5a3e, #a78362);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 12px 28px rgba(81, 52, 27, 0.18);
}

.signup-hero-content {
  display: grid;
  gap: 6px;
}

.signup-hero-title {
  margin: 0;
  color: #2d241d;
  font-size: 1.05rem;
  font-weight: 700;
}

.signup-step-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(220, 203, 187, 0.9);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 247, 0.96));
  box-shadow: 0 14px 32px rgba(81, 52, 27, 0.05);
}

.signup-step-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 106, 77, 0.1);
  color: #8a6a4d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.signup-step-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.signup-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(123, 90, 62, 0.12), rgba(167, 131, 98, 0.18));
  color: #6b4a30;
  font-size: 1rem;
}

.signup-step-icon-small {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.signup-step-title {
  margin: 0;
  font-size: 1.35rem;
  color: #2d241d;
}

.signup-step-copy {
  margin: 0;
  color: #5b4b3d;
  line-height: 1.7;
}

.signup-choice-grid,
.signup-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.signup-choice-card,
.signup-plan-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(220, 203, 187, 0.96);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdfb, #fff7f0);
  color: #2d241d;
  text-align: left;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
}

.signup-choice-card:hover,
.signup-plan-card:hover {
  border-color: #8a6a4d;
  background: linear-gradient(180deg, #fffdfb, #fff3e8);
  box-shadow: 0 16px 34px rgba(81, 52, 27, 0.1);
  transform: translateY(-2px);
}

.signup-choice-card.active,
.signup-plan-card.active {
  border: 2px solid #7a5435;
  background: linear-gradient(180deg, #fff9f2, #fbe7d7);
  box-shadow:
    0 18px 38px rgba(81, 52, 27, 0.14),
    0 0 0 4px rgba(168, 127, 90, 0.12);
  transform: translateY(-2px);
}

.signup-choice-card.active strong,
.signup-plan-card.active strong,
.signup-choice-card.active .signup-card-copy,
.signup-plan-card.active .signup-card-copy,
.signup-choice-card.active .signup-plan-price,
.signup-plan-card.active .signup-plan-price {
  color: #3f2817 !important;
}

.signup-choice-card.active .signup-card-top,
.signup-plan-card.active .signup-card-top {
  border-bottom-color: rgba(122, 84, 53, 0.28);
}

.signup-choice-card.active .signup-card-icon,
.signup-plan-card.active .signup-card-icon {
  background: linear-gradient(135deg, #7b5a3e, #a87f5a);
  color: #fff;
  box-shadow: 0 10px 20px rgba(81, 52, 27, 0.18);
}

.signup-plan-card.active .signup-plan-badge {
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(81, 52, 27, 0.14);
}

.signup-choice-card span,
.signup-plan-card span {
  color: #6d5845;
  line-height: 1.6;
}

.signup-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
}

.signup-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(123, 90, 62, 0.1);
  color: #7b5a3e;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.signup-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(123, 90, 62, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.signup-plan-badge-free {
  background: linear-gradient(135deg, #fff8cf, #ffe07a);
  color: #8a6400;
}

.signup-plan-badge-light {
  background: linear-gradient(135deg, #e7f3ff, #b8d9ff);
  color: #245ea8;
}

.signup-plan-badge-basic {
  background: linear-gradient(135deg, #e8f7ea, #bde7c5);
  color: #26653a;
}

.signup-plan-badge-pro {
  background: linear-gradient(135deg, #ffe8e8, #ffbcbc);
  color: #b13a2f;
}

.signup-card-copy {
  font-size: 0.97rem;
}

.signup-plan-price {
  color: #51341b !important;
  font-weight: 700;
  font-size: 22px;
  text-align: center;
}

.signup-credit-pack-section {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e4d6c8;
  border-radius: 16px;
  background: #fffdf9;
}

.signup-credit-pack-title {
  margin: 0;
  font-size: 1rem;
  color: #2d241d;
}

.signup-subsection-heading {
  gap: 10px;
}

.signup-address-section {
  display: grid;
  gap: 10px;
  padding: 0 18px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(220, 203, 187, 0.85);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(255, 249, 244, 0.92));
}

.signup-address-title {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #2d241d;
}

.address-label {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 0.98rem;
  color: #3d3026;
}

.signup-profile-plan-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.signup-profile-plan-name {
  color: #2d241d;
}

.signup-address-grid {
  display: grid;
  gap: 14px;
}

.signup-address-grid-primary {
  grid-template-columns: minmax(140px, 0.9fr) minmax(140px, 1fr) minmax(0, 1.6fr);
}

.signup-address-grid-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.signup-address-grid .field {
  margin-bottom: 0;
}

.signup-field-help {
  margin: 6px 0 0;
  color: #7b624d;
  font-size: 0.85rem;
  line-height: 1.6;
}

.signup-field-help.is-success {
  color: #0f766e;
}

.signup-field-help.is-error {
  color: #c0392b;
}

.signup-file-input {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #d6c6b6;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: #2d241d;
}

.signup-logo-upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  width: 100%;
  position: relative;
  z-index: 0;
}

/* グローバル input[type="file"] { width: 100% } による行のあふれ・重なりを防ぐ */
.signup-logo-upload-toolbar input[type="file"] {
  width: auto;
  max-width: 100%;
  flex: 1 1 180px;
  min-width: 0;
}

.signup-logo-remove-button {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: #8a6a4d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.signup-logo-remove-button:hover {
  color: #5c4637;
}

.signup-logo-file-input {
  flex: 1 1 180px;
  min-width: 0;
}

.signup-company-logo-preview {
  flex-shrink: 0;
  margin-top: 0;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e6d9cd;
  background: transparent;
}

.signup-credit-note {
  margin: 0;
  color: #6d5845;
  line-height: 1.7;
}

.signup-credit-price-table {
  display: grid;
  border: 1px solid #dccbbb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  max-width: 410px;
}

.signup-credit-price-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.signup-credit-price-row + .signup-credit-price-row {
  border-top: 1px solid #efe4d8;
}

.signup-credit-price-head {
  background: #f7efe6;
  font-weight: 700;
  color: #51341b;
}

.signup-credit-price-cell {
  padding: 12px 14px;
  color: #5b4b3d;
  line-height: 1.6;
  text-align: center;
}

.signup-submit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 2px;
  padding: 18px 22px;
  border: 1px solid rgba(220, 203, 187, 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 248, 241, 0.94));
}

.signup-submit-note {
  margin: 0;
  color: #6d5845;
  line-height: 1.7;
  text-align: center;
}

.signup-submit-button {
  position: relative;
  z-index: 1;
  min-width: 160px;
  margin: 0 auto;
  padding-inline: 28px;
}

.signup-submit-button:disabled {
  background: #d8cdc1;
  color: #8d7c6a;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.signup-success-text {
  margin: 0;
  color: #2f7a45;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none !important;
}

#company-customer-unlink-modal.modal-overlay {
  z-index: 110;
}

#account-delete-modal.modal-overlay {
  z-index: 110;
}

body.is-modal-open .header-auth,
body.is-modal-open .header-notification-root {
  pointer-events: none;
  user-select: none;
}

body.is-modal-open .header-auth.is-sticky {
  z-index: 1;
}

.spot-purchase-confirm-modal-card,
.spot-purchase-modal-card {
  width: min(480px, 100%);
}

.spot-purchase-options {
  display: grid;
  gap: 10px;
  margin: 14px 0 20px;
}

.spot-purchase-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.spot-purchase-option:has(.spot-purchase-option-input:checked) {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: rgba(239, 246, 255, 0.85);
}

.spot-purchase-option.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.spot-purchase-option-input {
  flex: 0 0 auto;
  margin: 0;
}

.spot-purchase-option-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.spot-purchase-option-count {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.spot-purchase-option-price {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

#spot-purchase-submit-button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#spot-purchase-submit-button.is-loading::before {
  content: "";
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.spot-purchase-success-message {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: #2d241d;
  text-align: center;
}

.spot-purchase-warning {
  margin: 14px 0 0;
  color: #b45309;
  font-size: 0.92rem;
  line-height: 1.55;
}


.account-delete-modal-error {
  margin: 12px 0 0;
}

.account-delete-billing-stop {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 20px 8px 8px;
  text-align: center;
}

.account-delete-billing-stop[hidden] {
  display: none !important;
}

.account-delete-billing-stop-text {
  margin: 0;
  color: #2d241d;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
}

.modal-card {
  width: min(520px, 100%);
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.35);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 250, 252, 0.7)
  );
}

.modal-title {
  margin: 0 !important;
  font-size: 1.05rem;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: #0f172a;
}

.modal-close:hover {
  background: rgba(15, 23, 42, 0.06);
}

.modal-body {
  padding: 16px 18px 6px;
}

.modal-copy {
  margin: 0 0 14px;
  line-height: 1.7;
  color: #334155;
  font-size: 1rem;
}

.signup-dialog-plan-table-wrap {
  max-width: 360px;
  margin: 0 auto 16px;
  border: 1px solid #e4d6c8;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
}

.signup-dialog-plan-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 0;
  background: transparent;
  font-size: 0.92rem;
  margin: 0;
}

.signup-dialog-plan-table-caption {
  max-width: 360px;
  margin: 0 auto 10px;
  color: #8a6a4d;
  font-size: 0.85rem;
  font-weight: 800;
  text-align: left;
}

.signup-dialog-plan-table thead th {
  padding: 9px 12px;
  border-bottom: 1px solid #eee2d5;
  background: linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(255, 255, 255, 0.94));
  color: #8a6a4d;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.signup-dialog-plan-table thead tr:first-child th:first-child {
  border-top-left-radius: 11px;
}

.signup-dialog-plan-table thead tr:first-child th:last-child {
  border-top-right-radius: 11px;
}

.signup-dialog-plan-table tbody th,
.signup-dialog-plan-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f2ebe3;
  vertical-align: middle;
}

.signup-dialog-plan-table tbody tr:last-child th,
.signup-dialog-plan-table tbody tr:last-child td {
  border-bottom: none;
}

.signup-dialog-plan-table tbody tr:last-child th:first-child {
  border-bottom-left-radius: 11px;
}

.signup-dialog-plan-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 11px;
}

.signup-dialog-plan-table tbody th {
  font-weight: 700;
  text-align: center;
}

.signup-dialog-plan-table tbody td {
  color: #2d241d;
  font-weight: 700;
  text-align: right;
}

.signup-dialog-plan-table .signup-plan-badge {
  min-width: 72px;
  height: 30px;
  font-size: 0.74rem;
  text-transform: none;
  letter-spacing: 0.02em;
}
.modal-copy-note{
  font-size: 0.9rem;
}

.modal-copy-invite-expiry {
  white-space: nowrap;
  font-size: 0.9rem;
  color: #8a6a4d;
}

.signup-local-dev-verify {
  margin-top: 4px;
  margin-bottom: 0;
}

.signup-local-dev-verify-link {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  background: #7a4f2c;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.signup-local-dev-verify-link:hover {
  background: #5f3d22;
  color: #fff;
}

.modal-form-field {
  display: grid;
  gap: 8px;
}

.modal-form-label {
  color: #475569;
  font-weight: 700;
}

.modal-form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d6c6b6;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.modal-form-input-inline {
  display: inline-block;
  width: auto;
  min-width: 180px;
  padding: 8px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.modal-grant-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.modal-grant-row .modal-form-label {
  margin: 0;
  white-space: nowrap;
}

.modal-grant-input {
  width: 80px;
  padding: 10px 12px;
  text-align: right;
}

.modal-grant-count {
  font-size: 1.3em;
  font-weight: 900;
}

.modal-form-message {
  margin: 12px 0 0;
  color: #6d5845;
  line-height: 1.6;
}

.modal-form-message-line {
  margin: 0;
}

.modal-form-message-line + .modal-form-message-line {
  margin-top: 8px;
}

.modal-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 252, 0.8);
  color: #0f172a;
}

.modal-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.modal-check-plain {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: #0f172a;
}

.modal-check-plain input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.signup-legal-agree {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.signup-legal-agree input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.modal-inline-link {
  color: #51341b;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-inline-link:hover {
  color: #7d5e43;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
}

.modal-actions[hidden] {
  display: none !important;
}

.modal-actions.modal-actions-sub {
  padding-top: 0;
  justify-content: flex-start;
}

.modal-actions.modal-actions-sub .error-text {
  margin: 0;
}

.company-directory-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 18px;
}

.company-directory-card-upper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* URL 直下の白パネル：評価・対応地域。コンタクトはパネル外の下に並べる */
.company-directory-card-panel {
  margin-top: 14px;
  padding: 14px 12px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(230, 217, 205, 0.95);
  box-shadow: 0 1px 4px rgba(45, 36, 29, 0.06);
}

.company-directory-card-rating-panel {
  padding-bottom: 14px;
}

.company-directory-card-regions .company-label {
  margin-bottom: 8px;
}

.company-directory-card-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.company-directory-dm-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

/* DM は他コンタクトと別扱い：連絡先アイコンがあるときだけ区切り線 */
.company-directory-card-contacts:has(.company-directory-contact-btn)
  .company-directory-dm-wrap::after {
  content: "";
  display: block;
  width: 1px;
  align-self: center;
  height: 44px;
  margin-left: 15px;
  background: rgba(214, 198, 182, 0.95);
  flex-shrink: 0;
}

.company-directory-dm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #8a6a4d;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(45, 36, 29, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.company-directory-dm-btn i {
  font-size: 1.35rem;
}

.company-directory-card-upper + .company-directory-card-contacts {
  margin-top: 14px;
}

.company-directory-card-panel + .company-directory-card-contacts {
  margin-top: 14px;
}

.company-directory-contact-btn {
  flex: 0 0 auto;
}

.company-directory-contact-btn .company-rich-link-badge {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  box-shadow:
    0 2px 8px rgba(45, 36, 29, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.company-directory-contact-btn.is-line .company-rich-link-badge {
  background: #06c755;
  color: #fff;
  box-shadow:
    0 2px 8px rgba(45, 36, 29, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.company-directory-contact-btn.is-line .company-rich-link-badge i {
  display: inline-block;
}

.company-directory-contact-btn .company-rich-link-badge i {
  font-size: 1.35rem;
}

.company-card-summary {
  margin: -24px -16px 0;
  padding: 20px 16px;
  border-radius: 16px 16px 0 0;
  border-bottom: 1px solid #e7dbcf;
}

.company-card {
  padding: 20px 16px;
  border: 1px solid #dccbbb;
  border-radius: 16px;
  background: #fff;
}

.company-empty-text {
  margin: 0;
  color: #6d5845;
  line-height: 1.7;
}

.company-inquiry-notice {
  display: grid;
  gap: 8px;
  border-color: #efc1bc;
  background: linear-gradient(180deg, #fff6f5 0%, #fdf0ee 100%);
  box-shadow: 0 10px 24px rgba(177, 58, 47, 0.06);
  margin-bottom: 20px;
}

.company-inquiry-notice-title,
.company-inquiry-notice-copy {
  margin: 0;
}

.company-inquiry-notice-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #b13a2f;
  font-weight: 700;
  font-size: 1rem;
}

.company-inquiry-notice-icon {
  flex: 0 0 auto;
  font-size: 1.1rem;
}

.company-inquiry-notice-copy {
  color: #6d5845;
  line-height: 1.7;
}

.company-inquiry-inline-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: #1a73e8;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.company-inquiry-inline-link:hover,
.company-inquiry-inline-link:focus-visible {
  color: #1557b0;
}

.company-inquiry-benefits {
  display: grid;
  gap: 10px;
  margin: 0;
}

.company-inquiry-benefits-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #b13a2f;
  line-height: 1.35;
}

.company-inquiry-benefits-kicker-icon {
  flex: 0 0 auto;
  font-size: 1.05rem;
}

.company-inquiry-benefits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.company-inquiry-benefits-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(177, 58, 47, 0.14);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #4a3d32;
}

.company-inquiry-benefits-item-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 1.1rem;
  color: #c84b3f;
}

.company-card-primary {
  /* background: linear-gradient(180deg, #fffaf5 0%, #f8efe5 100%); */
  background: #fcfcf8;
}

.company-filter-label {
  display: inline-flex;
  align-items: center;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.company-filter-select {
  width: 160px;
  padding: 12px 14px;
  border: 1px solid #d6c6b6;
  border-radius: 12px;
  background: #fff;
  color: #2d241d;
  font: inherit;
}

.company-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.company-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #51341b;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.company-logo:has(.company-logo-image) {
  background: transparent;
}

.company-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}

.company-logo-fallback-icon {
  font-size: 1.45rem;
  line-height: 1;
  opacity: 0.95;
}

.company-kicker {
  margin: 0 0 4px;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.company-name {
  margin: 0;
  color: #2d241d;
  font-size: 1.1rem;
}

.company-label {
  /* display: inline-flex; */
  align-items: center;
  margin: 0 0 8px;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.company-value {
  margin: 0;
  color: #2d241d;
  line-height: 1.7;
}

.company-link,
.company-site-link {
  color: #51341b;
  text-decoration: none;
  font-weight: 700;
}

.company-site-link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.company-rating-block {
  width: 100%;
}

.company-rating-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  color: #51341b;
  text-align: left;
}

.company-rating-toggle:hover {
  color: #7a4f2d;
}

.company-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.company-rating-stars-lg .company-rating-star {
  font-size: 1.1rem;
}

.company-rating-star {
  color: #f59e0b;
  font-size: 0.92rem;
  line-height: 1;
}

.company-rating-star.fa-regular.fa-star {
  color: #d1c4b8;
}

.company-rating-summary-text {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.88rem;
}

.company-rating-average {
  font-size: 0.95rem;
  font-weight: 800;
  color: #2d241d;
}

.company-rating-count,
.company-rating-empty-label {
  color: #6d5845;
  font-size: 0.84rem;
}

.company-rating-chevron {
  margin-left: auto;
  font-size: 0.72rem;
  color: #8a7563;
}

.company-rating-accordion {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(214, 198, 182, 0.7);
}

.company-rating-status {
  margin: 0;
  font-size: 0.88rem;
  color: #6d5845;
}

.company-rating-detail-head {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-bottom: 14px;
  text-align: center;
}

.company-rating-detail-average {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: #2d241d;
  line-height: 1;
}

.company-rating-detail-count {
  margin: 0;
  font-size: 0.84rem;
  color: #6d5845;
}

.company-rating-distribution {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.company-rating-distribution-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
}

.company-rating-distribution-label,
.company-rating-distribution-count {
  font-size: 0.82rem;
  color: #6d5845;
}

.company-rating-distribution-count {
  text-align: right;
}

.company-rating-distribution-bar {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #efe4d8;
  overflow: hidden;
}

.company-rating-distribution-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f59e0b;
}

.company-rating-review-list {
  display: grid;
  gap: 12px;
}

.company-rating-show-more-reviews-btn {
  display: block;
  width: 180px;
  margin: 12px auto 0;
  padding: 8px 12px;
  border: 1px solid rgba(201, 178, 157, 0.55);
  border-radius: 20px;
  background: #fff;
  color: #51341b;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.company-rating-show-more-reviews-btn:hover,
.company-rating-show-more-reviews-btn:focus-visible {
  background: rgba(247, 242, 236, 0.95);
  border-color: rgba(138, 75, 45, 0.45);
}

.company-rating-comments {
  margin-bottom: 0;
}

.company-rating-comments .company-rating-review-list {
  margin-bottom: 0;
}

.company-rating-review-item {
  padding-top: 12px;
  border-top: 1px solid rgba(214, 198, 182, 0.7);
}

.company-rating-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.company-rating-review-date {
  font-size: 0.78rem;
  color: #8a7563;
}

.company-rating-review-author {
  margin: 6px 0 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #2d241d;
}

.company-rating-review-body {
  margin: 6px 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
}

.company-rating-no-reviews {
  margin: 0;
  padding: 18px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: center;
  color: #6d5845;
}

.company-rating-detail-body {
  display: grid;
  gap: 0;
}

.company-rating-post-btn {
  width: 100%;
  margin-top: 16px;
}

.company-rating-form-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(214, 198, 182, 0.7);
}

.company-rating-post-dialog-card {
  width: min(100%, 480px);
}

.company-rating-post-dialog-body.company-rating-form-fields {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.company-rating-form-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #2d241d;
}

.company-rating-input-stars {
  display: flex;
  gap: 4px;
  margin: 12px 0;
}

.company-rating-input-star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
}

.company-rating-input-star-btn:hover,
.company-rating-input-star-btn:focus-visible {
  background: rgba(247, 242, 236, 0.9);
}

.company-rating-input-star-btn .company-rating-star {
  font-size: 1.25rem;
}

.company-rating-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.company-rating-field-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #51341b;
}

.company-rating-field-input,
.company-rating-field-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(201, 178, 157, 0.55);
  border-radius: 10px;
  background: #fff;
  color: #2d241d;
}

.company-rating-field-textarea {
  resize: vertical;
  min-height: 96px;
}

.company-rating-submit-btn {
  width: 100%;
  margin-top: 0;
}

.company-rating-image-field {
  margin-bottom: 0;
}

.company-rating-image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.company-rating-image-preview-wrap {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.company-rating-image-preview {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(201, 178, 157, 0.55);
  background: #fff;
}

.company-rating-image-remove-btn {
  margin: 0;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: #8a4b2d;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.company-rating-image-picker-btn {
  width: 100%;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.company-rating-image-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.company-rating-image-help {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #8a7563;
}

.company-rating-review-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.company-rating-review-image-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(201, 178, 157, 0.45);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.company-rating-review-image-btn:hover,
.company-rating-review-image-btn:focus-visible {
  border-color: rgba(138, 75, 45, 0.55);
  box-shadow: 0 0 0 2px rgba(201, 178, 157, 0.35);
}

.company-rating-review-image-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.company-rating-image-viewer-overlay {
  padding: 24px 16px;
}

.company-rating-image-viewer-card {
  position: relative;
  width: min(100%, 960px);
  max-height: calc(100vh - 48px);
  margin: 0 auto;
}

.company-rating-image-viewer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(35, 31, 26, 0.72);
  color: #fff;
  cursor: pointer;
}

.company-rating-image-viewer-close:hover,
.company-rating-image-viewer-close:focus-visible {
  background: rgba(35, 31, 26, 0.88);
}

.company-rating-image-viewer-img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.company-rating-ineligible {
  margin: 10px 0 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: #6d5845;
}

.company-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.company-rich-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #2d241d;
  text-decoration: none;
  font-weight: 700;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.company-rich-link:hover {
  transform: translateY(-1px);
}

.company-rich-link-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 40px;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.company-rich-link-badge i {
  font-size: 1.5rem;
}

.company-rich-link-label {
  color: inherit;
}

.company-rich-link.is-line .company-rich-link-badge {
  background: #06c755;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.company-rich-link.is-line .company-rich-link-badge i {
  display: inline-block;
  font-size: 1.7rem
}

.company-rich-link.is-instagram .company-rich-link-badge {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 52%, #8134af 100%);
}

.company-rich-link.is-x .company-rich-link-badge {
  background: #111111;
}

.company-rich-link.is-contact .company-rich-link-badge {
  background: #0f766e;
}

.company-rich-link.is-phone .company-rich-link-badge {
  background: #5aa9e6;
}

button.company-rich-link {
  font: inherit;
  cursor: pointer;
}

.company-phone-dialog-details {
  display: grid;
  gap: 14px;
  margin: 0 0 4px;
}

.company-phone-dialog-row {
  display: grid;
  gap: 4px;
  margin: 0;
}

.company-phone-dialog-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
}

.company-phone-dialog-value {
  margin: 0;
  font-size: 1.02rem;
  color: #0f172a;
  line-height: 1.5;
}

.company-phone-dialog-number {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.company-phone-dialog-confirm {
  margin-top: 4px;
}

.company-detail-block + .company-detail-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee2d5;
}

.margin_0{
  margin-bottom: 0;
}
.margin_10{
  margin-bottom: 10px;
}
.margin_20{
  margin-bottom: 20px;
}
.margin_30{
  margin-bottom: 30px;
}

@media (max-width: 1000px) {
  .input-sections,
  .mypage-grid,
  .mypage-usage-stats,
  .mypage-stat-grid,
  .field-group,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .header-shell {
    grid-template-columns: 1fr;
  }

  .header-auth {
    top: 16px;
    right: 16px;
  }

  .header-auth.is-sticky {
    top: 16px;
    right: 16px;
  }

  .auth-actions,
  .auth-session {
    justify-content: flex-end;
  }

  .mypage-postal-code-row {
    grid-template-columns: 1fr;
  }

  .mypage-address-grid-primary {
    /* 郵便番号 + 都道府県は狭幅でも1行に収める */
    grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1fr);
  }

  .mypage-address-grid-secondary {
    grid-template-columns: 1fr;
  }



  .header-auth .auth-actions {
    gap: 8px;
  }

  .header-auth .auth-actions .auth-button {
    min-height: 31px;
    padding: 7px 11px;
    font-size: 0.9rem;
  }

  .header-auth .auth-actions .button-icon {
    margin-right: 6px;
  }

  .header-bar {
    padding: 0;
  }

  .image-frame.large {
    min-height: 320px;
  }
  .hero h1{
    font-size: 1.9rem;
  }
}

@media (max-width: 960px) {
  .company-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-directory-toolbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .signup-choice-grid,
  .signup-plan-grid {
    grid-template-columns: 1fr;
  }

  .signup-hero-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .signup-submit-row {
    flex-direction: column;
    align-items: stretch;
  }

  .signup-profile-plan-row {
    align-items: flex-start;
  }

}

@media (max-width: 800px) {
  .signup-address-grid-primary {
    grid-template-columns: minmax(100px, 0.9fr) minmax(100px, 1fr);
  }

  .signup-address-field-municipality {
    grid-column: 1 / -1;
  }

  .signup-address-grid-secondary {
    grid-template-columns: 1fr;
  }
}

.result-info-card {
  padding: 14px 16px;
  border: 1px solid #dccbbb;
  border-radius: 14px;
  background: #fff;
}

.result-info-label {
  margin: 0 0 8px;
  color: #8a6a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.result-info-value {
  margin: 0;
  color: #2d241d;
  font-weight: 600;
  line-height: 1.7;
}

.result-info-subvalue {
  margin: 4px 0 0;
  color: #6d5845;
  line-height: 1.6;
}

.result-color-detail {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-info-value.multiline {
  white-space: pre-wrap;
}

.actions button:disabled {
  background: #b7ab9f;
  color: #f7f3ee;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.result-meta {
  margin-bottom: 16px;
  color: #5b4b3d;
  line-height: 1.7;
}

.loading-note {
  margin: 0 0 16px;
  color: #6d5845;
  line-height: 1.6;
  text-align: center;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 320px);
  width: min(100%, 320px);
  padding: 14px 20px;
  border-radius: 12px;
  background: #51341b;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(81, 52, 27, 0.18);
}

.error-text {
  margin-top: 10px;
  color: #c0392b;
  font-weight: 700;
  text-align: center;
}

.signup-error-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}



@media (max-width: 800px) {
  #header{
    padding: 0;
    background: none;
  }
  #header-inner{
    padding: 0;
  }
  .header-bar {
    padding-top: 50px;
  }
  .header-bar-image{
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  .company-directory-grid {
    grid-template-columns: 1fr;
  }
  .paint-catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }
}

@media (max-width: 500px) {
  #main-inner, .main-inner, #header-inner, #footer-inner{
    padding: 0;
  }

  .header-auth {
    top: 10px;
    right: 10px;
  }

  .eyebrow {
    margin-bottom: 10px;
    /* padding: 5px 10px; */
  }

  .header-auth .auth-actions .auth-button {
    font-size: 0.7rem;
  }

  .panel{
    padding: 16px;
  }

  .hero h1{
    font-size: 1.5rem;
  }

  .paint-catalog-item{
    padding: 3px;
  }

  .signup-credit-price-cell {
    padding: 12px 6px;
  }
}

/* DM dialog (company ↔ linked customer) */
.dm-dialog-overlay {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 16px;
  max-width: 100vw;
  overflow: hidden;
  background: rgba(45, 36, 29, 0.18);
  backdrop-filter: blur(2px);
  z-index: 130;
}

.dm-dialog-card {
  display: flex;
  flex-direction: column;
  width: min(390px, 100%);
  max-width: 100%;
  min-width: 0;
  height: min(78vh, 720px);
  max-height: calc(100vh - 32px);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fffaf5;
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.35);
  overflow: hidden;
}

.dm-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8dfd4;
  background: linear-gradient(180deg, #fffaf5 0%, #f8efe5 100%);
  flex-shrink: 0;
}

.dm-dialog-head-text {
  min-width: 0;
}

.dm-dialog-kicker {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #8a6a4d;
}

.dm-dialog-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #2d241d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-dialog-title-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.dm-dialog-title-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #efe4d7;
  color: #7a5a3f;
  overflow: hidden;
}

.dm-dialog-title-avatar.is-company {
  background: #f0e6dc;
  color: #7a5a3f;
}

.dm-dialog-title-avatar.is-customer {
  background: #eceff8;
  color: #52638d;
}

.dm-dialog-title-avatar--image {
  background: transparent;
}

.dm-dialog-title-avatar i {
  font-size: 0.95rem;
  line-height: 1;
}

.dm-dialog-title-avatar--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dm-dialog-title-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-dialog-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: #5b4b3d;
}

.dm-dialog-close:hover {
  background: rgba(91, 75, 61, 0.08);
}

.dm-dialog-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f3ebe2;
}

.dm-dialog-status {
  margin: 0;
  text-align: center;
  color: #7a6554;
  font-size: 0.9rem;
  font-weight: 700;
}

.dm-dialog-message-row {
  display: flex;
  justify-content: flex-start;
}

.dm-dialog-message-row.is-mine {
  justify-content: flex-end;
}

.dm-dialog-message-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 82%;
  min-width: 0;
}

.dm-dialog-message-row.is-mine .dm-dialog-message-stack {
  align-items: flex-end;
}

.dm-dialog-bubble {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e6d9cd;
  box-shadow: 0 2px 8px rgba(73, 44, 20, 0.06);
}

.dm-dialog-message-row.is-mine .dm-dialog-bubble {
  background: #fff3e8;
  border-color: rgba(200, 75, 63, 0.22);
}

.dm-dialog-bubble-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: #2d241d;
  font-size: 0.92rem;
}

.dm-dialog-bubble-muted {
  color: #7a6554;
  font-style: italic;
}

.dm-dialog-bubble-image {
  display: block;
  width: 100%;
  max-width: 220px;
  border-radius: 10px;
}

.dm-dialog-bubble-image-color {
  margin: 8px 0 0;
}

.dm-dialog-bubble-image-color-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  color: #5b4b3d;
}

.dm-dialog-color-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(45, 36, 29, 0.22);
  flex-shrink: 0;
}

.dm-dialog-message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.dm-dialog-message-row.is-mine .dm-dialog-message-meta {
  justify-content: flex-end;
}

.dm-dialog-read-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  color: #8a6a4d;
  white-space: nowrap;
}

.dm-dialog-message-time {
  display: block;
  margin: 0;
  padding: 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  color: #8a6a4d;
  white-space: nowrap;
}

.dm-dialog-error {
  flex-shrink: 0;
  margin: 0;
  padding: 0 14px 8px;
}

.dm-dialog-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e8dfd4;
  background: #fff;
  flex-shrink: 0;
}

.dm-dialog-composer-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.dm-dialog-composer-row .dm-dialog-input {
  flex: 1 1 auto;
  min-width: 0;
}

.dm-dialog-composer-actions {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 8px;
  width: 44px;
  align-self: stretch;
}

.dm-dialog-composer-actions .dm-dialog-image-btn,
.dm-dialog-composer-actions .dm-dialog-send {
  flex: 1 1 0;
  width: 44px;
  min-height: 0;
  height: auto;
  border-radius: 14px;
}

.dm-dialog-image-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid #d6c6b6;
  background: #fff;
  color: #8a6a4d;
  cursor: pointer;
}

.dm-dialog-image-btn:hover:not(:disabled) {
  background: #fff8ef;
  color: #51341b;
}

.dm-dialog-image-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dm-dialog-image-btn:focus-visible {
  outline: 2px solid #c84b3f;
  outline-offset: 2px;
}

.dm-dialog-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e8dfd4;
  border-radius: 14px;
  background: #fffaf5;
}

.dm-dialog-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dm-dialog-picker-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: #6d4f32;
}

.dm-dialog-picker-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #8a6a4d;
  cursor: pointer;
}

.dm-dialog-picker-close:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
}

.dm-dialog-picker-status {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  color: #8a6a4d;
}

.dm-dialog-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.dm-dialog-picker-item {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #d6c6b6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.dm-dialog-picker-item:hover:not(:disabled) {
  border-color: #c4a882;
}

.dm-dialog-picker-item:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dm-dialog-picker-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-dialog-input {
  width: 100%;
  min-height: 44px;
  max-height: 160px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #d6c6b6;
  border-radius: 14px;
  font: inherit;
  line-height: 1.45;
  color: #2d241d;
  background: #fff;
}

.dm-dialog-input:disabled {
  opacity: 0.7;
}

.dm-dialog-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.dm-dialog-send i {
  font-size: 1rem;
  line-height: 1;
}

/* 390px 以下: DM を縦横ほぼ全画面（ノッチ等は safe-area を確保） */
@media (max-width: 390px) {
  .dm-dialog-overlay {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding:
      max(6px, env(safe-area-inset-top, 0px))
      max(6px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px))
      max(6px, env(safe-area-inset-left, 0px));
  }

  .dm-dialog-card {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: none;
    min-height: 0;
    min-width: 0;
    flex: 1 1 auto;
    border-radius: 16px;
  }

  .dm-dialog-messages {
    flex: 1 1 auto;
  }

  .dm-dialog-picker-grid {
    max-height: min(36vh, 220px);
  }
}

.mypage-billing-request-status {
  margin-top: 0.75rem;
  color: #355a47;
  font-size: 0.95rem;
}

.app-manager-spot-purchases-panel {
  margin-bottom: 1.25rem;
}

.app-manager-spot-purchases-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.app-manager-spot-purchases-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.app-manager-spot-purchases-filter {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #c9d9cf;
  background: #fff;
  color: #355a47;
  font-size: 0.85rem;
  cursor: pointer;
}

.app-manager-spot-purchases-filter.is-active {
  border-color: #3f7258;
  background: #e6f0ea;
  font-weight: 600;
}

.app-manager-spot-purchases-msg {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.app-manager-spot-purchases-msg[data-kind="success"] {
  color: #2f6b4f;
}

.app-manager-spot-purchases-msg[data-kind="error"] {
  color: #b42318;
}

.app-manager-spot-purchases-empty {
  margin: 0;
  color: #5d7467;
  font-size: 0.92rem;
}

.app-manager-spot-purchases-empty.app-manager-spot-purchases-error {
  color: #b42318;
}

.app-manager-spot-purchases-table-wrap {
  overflow-x: auto;
}

.app-manager-spot-purchases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.app-manager-spot-purchases-table th,
.app-manager-spot-purchases-table td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid #e3ebe6;
  text-align: left;
  vertical-align: top;
}

.app-manager-spot-purchases-table th {
  color: #5d7467;
  font-weight: 600;
  white-space: nowrap;
}

.app-manager-spot-purchase-account {
  font-weight: 600;
  color: #234434;
}

.app-manager-spot-purchase-email {
  margin-top: 0.15rem;
  color: #5d7467;
  font-size: 0.82rem;
}

.app-manager-spot-purchase-status[data-status="pending_payment"] {
  color: #9a6700;
  font-weight: 600;
}

.app-manager-spot-purchase-status[data-status="paid"] {
  color: #2f6b4f;
  font-weight: 600;
}

.app-manager-spot-purchase-status[data-status="cancelled"] {
  color: #667781;
}

.app-manager-spot-purchase-locked {
  margin-top: 0.2rem;
  color: #9a6700;
  font-size: 0.82rem;
}

.app-manager-spot-purchase-actions {
  white-space: nowrap;
}
