/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 130px; /* ヘッダーの高さ分のオフセット */
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }
    /* Slightly smaller base text for German (long compounds); ~1px below default 16px */
    html:lang(de) {
        font-size: 15px;
    }
    #services,
    #contact {
        scroll-margin-top: 90px;
    }
}

@media (max-width: 480px) {
    html {
        scroll-padding-top: 70px;
    }
    #services,
    #contact {
        scroll-margin-top: 80px;
    }
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

/* Hide [data-lang] until multi-lang applies .lang-loaded (avoids flash of wrong language in header/body when switching locale) */
[data-lang]:not(.lang-loaded) {
    visibility: hidden;
}

[data-lang].lang-loaded {
    visibility: visible;
}

/* Portal pages: data-portal-lang (same visibility behavior as data-lang) */
[data-portal-lang]:not(.lang-loaded) {
    visibility: hidden;
}

[data-portal-lang].lang-loaded {
    visibility: visible;
}

/* Cookie Banner Responsive Styles */
#cookie-banner {
    position: fixed;
    inset: auto 0 0 0;
    background: #1a1a1a;
    color: #f0f0f0;
    padding: 16px;
    display: none;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

#cookie-banner > div {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

#cookie-banner > div > div:first-child {
    flex: 1;
    min-width: 0; /* Allow shrinking below min-content */
    font-size: 0.95rem;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: manual;
    color: #f0f0f0;
}

#cookie-banner > div > div:first-child span {
    display: block;
    width: 100%;
    max-width: 100%;
}

#cookie-banner > div > div:last-child {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

#cookie-banner button {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
}

#cookie-banner #cb-reject {
    background: #333;
    color: #fff;
    border: 1px solid #666;
}

#cookie-banner #cb-customize {
    background: #444;
    color: #fff;
    border: 1px solid #777;
}

#cookie-banner #cb-accept {
    background: #22a35a;
    color: #fff;
}

#cookie-banner a {
    color: #9ecbff;
    text-decoration: underline;
}

/* Tablets & phones: stack text and buttons for readability */
@media (max-width: 768px) {
    #cookie-banner {
        padding: 14px 12px;
        max-height: 45vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #cookie-banner > div {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    #cookie-banner > div > div:first-child {
        font-size: 0.9rem;
        line-height: 1.65;
        flex: none;
    }

    #cookie-banner > div > div:last-child {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

    #cookie-banner button {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.85rem;
        padding: 10px 8px;
    }
}

/* iPhone SE and small screens (375px and below) */
@media (max-width: 375px) {
    #cookie-banner {
        padding: 12px 10px;
    }
    
    #cookie-banner > div > div:first-child {
        font-size: 0.88rem;
    }
    
    #cookie-banner button {
        font-size: 0.8rem;
        padding: 9px 6px;
    }
}

/* Small screens (up to 480px) — extra tap targets */
@media (max-width: 480px) {
    #cookie-banner > div > div:first-child {
        font-size: 0.9rem;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1rem 0;
    font-family: 'Noto Sans JP', sans-serif;
}

.navbar .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.25rem;
}

.login-button {
    margin-left: 1rem;
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.header-actions .login-button {
    margin-left: 0;
}

.contract-button {
    background: #f3f6ff;
    color: #2e4f9e;
    border: 1px solid #c8d4fb;
    box-shadow: none;
}

.contract-button:hover {
    box-shadow: 0 2px 8px rgba(46, 79, 158, 0.18);
}

.logo a {
    display: inline-block;
    text-decoration: none;
}

.logo-img {
    height: 90px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

.lang-switcher {
    margin-left: 0.35rem;
    margin-right: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #1a4d7d;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #2c5f8d 0%, #1a4d7d 100%);
    padding: 100px 0;
}

.nodes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
}

.hero-text {
    color: white;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-woman-img {
    width: 100%;
    max-width: 520px;
    height: auto;
    border-radius: 16px;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.2;
    text-align: left;
}

.title-line {
    display: block;
}

.subtitle {
    font-size: 2rem;
    font-weight: 300;
    margin-top: 1rem;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-align: left;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: white;
    color: #1a4d7d;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Company Info Section */
.company-info {
    padding: 120px 0 80px;
    background-color: #f8f9fa;
}

.company-info h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.company-overview {
    max-width: 1000px;
    margin: 0 auto;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 4rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item a {
    color: #1a4d7d;
    text-decoration: underline;
    transition: color 0.3s;
}

.info-item a:hover {
    color: #0d3d56;
}

.info-item h3 {
    color: #1a4d7d;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.info-item p {
    color: #666;
    line-height: 1.8;
}

/* Mission Section */
.mission-section {
    padding: 120px 0 80px;
    background: white;
}

.mission-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #333;
    text-align: center;
    max-width: 800px;
    margin: 2rem auto 0;
}

/* Vision Section */
.vision-section {
    padding: 120px 0 80px;
    background: #f8f9fa;
}

.vision-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #333;
    text-align: center;
    max-width: 800px;
    margin: 2rem auto 0;
}

/* Brand Message Section */
.brand-message-section {
    padding: 120px 0 80px;
    background: white;
}

.brand-message-content {
    max-width: 900px;
    margin: 3rem auto 0;
}

.brand-message-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    text-align: center;
    max-width: 800px;
    margin: 2rem auto 0;
}

/* Core Values Section */
.core-values-section {
    padding: 120px 0 80px;
    background: white;
}

.core-values-list {
    max-width: 900px;
    margin: 3rem auto 0;
}

.core-value-item {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    border-left: 4px solid #1a4d7d;
    margin-bottom: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.core-value-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.core-value-letter {
    font-size: 4rem;
    font-weight: 700;
    color: #1a4d7d;
    line-height: 1;
    flex-shrink: 0;
    min-width: 80px;
    text-align: center;
}

.core-value-content {
    flex: 1;
}

.core-value-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a4d7d;
    margin-bottom: 0.5rem;
}

.core-value-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.core-value-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .mission-section, .vision-section, .brand-message-section, .core-values-section {
        padding: 90px 0 60px;
    }
    
    .mission-text, .vision-text {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .brand-message-text {
        font-size: 1.1rem;
        padding: 0 1rem;
        line-height: 1.8;
    }
    
    .core-value-item {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .core-value-letter {
        font-size: 3rem;
        min-width: auto;
    }
    
    .core-value-title {
        font-size: 1.3rem;
    }
    
    .core-value-subtitle {
        font-size: 1rem;
    }
    
    .core-value-description {
        font-size: 0.95rem;
    }
}

.officers-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.officer-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.officer-item h4 {
    color: #1a4d7d;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.officer-item p {
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

.officer-photo-small {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-placeholder-small {
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

.photo-placeholder-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.officer-info-simple {
    text-align: center;
}

.officer-info-simple h3 {
    color: #1a4d7d;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.officer-info-simple h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
}

/* Services Section */
#services,
#contact {
    scroll-margin-top: 140px;
}

.services {
    padding: 120px 0 80px;
    background-color: #f8f9fa;
}

.services-grid {
    display: grid;
    /* min(100%, 300px) prevents column min-width from exceeding the container (avoids horizontal scroll on narrow phones) */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.service-icon {
    color: #1a4d7d;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.service-card p {
    color: #666;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
}

.service-card-desc {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.service-card .service-card-cta {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    background-color: #2E7D32;
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.35);
}
.service-card .service-card-cta:hover {
    background: linear-gradient(135deg, #43A047 0%, #1B5E20 100%);
    background-color: #1B5E20;
    color: white;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.45);
}

/* Homecare CTA on index service cards (replaces long inline styles; stays inside card on narrow screens) */
.service-card .service-homecare-link {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
    line-height: 1.3;
}

.service-card .service-homecare-link:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.4);
}

/* Contact Section */
.contact {
    padding: 120px 0 80px;
    background: white;
}

.contact-form {
    max-width: 600px;
    margin: 3rem auto 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a4d7d;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label a {
    color: #1a4d7d;
    text-decoration: underline;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1a4d7d 0%, #0d3d56 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.submit-button:hover {
    transform: translateY(-2px);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    display: block;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    display: block;
}

/* Officers Section */
.officers-section {
    padding: 140px 0 100px;
}

.officers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.officer-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.officer-card:hover {
    transform: translateY(-5px);
}

.officer-photo {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: linear-gradient(135deg, #1a4d7d 0%, #0d3d56 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.photo-placeholder p {
    color: white;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.officer-info {
    padding: 2rem;
}

.officer-info h3 {
    color: #1a4d7d;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.officer-info h4 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
}

.officer-info p {
    color: #666;
    line-height: 1.8;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a4d7d 0%, #0d3d56 100%);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #fff;
}

.footer-section p {
    color: #ccc;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .logo-img {
        height: 50px;
    }


    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: left 0.3s;
        padding: 2rem 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        /* Keep out of the header row (flex order + no flex growth) */
        order: 10;
        flex: 0 0 0;
        min-width: 0;
        overflow: visible;
        align-self: center;
        /* Ensure menu is completely hidden when closed */
        pointer-events: none;
    }

    .nav-menu.active {
        left: 0;
        pointer-events: auto;
    }

    .navbar .container {
        gap: 0.5rem;
        flex-wrap: nowrap;
        align-items: center;
        min-width: 0;
        padding-right: 20px;
    }

    /* Hamburger left, logo next — frees space for lang + login on the right */
    .hamburger {
        display: flex;
        order: -2;
        margin-left: 0;
        margin-right: 0;
        flex-shrink: 0;
    }

    .navbar .logo {
        order: -1;
        flex-shrink: 1;
        min-width: 0;
    }

    .lang-switcher {
        order: 2;
        margin-left: 0;
        margin-right: 0.15rem;
        flex-shrink: 0;
    }

    .header-actions {
        order: 1;
        margin-left: auto;
        margin-right: 0.25rem;
        gap: 0.35rem;
        flex-shrink: 0;
        position: static;
        top: auto;
        right: auto;
        transform: none;
    }

    /* Keep both buttons visible on mobile; long labels use ellipsis. */
    .header-actions .login-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.38rem 0.58rem;
        font-size: 0.7rem;
        max-width: min(6.7rem, 30vw);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
    }

    .company-info {
        padding: 90px 0 60px;
    }

    .services {
        padding: 90px 0 60px;
    }

    .contact {
        padding: 90px 0 60px;
    }

    .officers-section {
        padding: 100px 0 80px;
    }

    .hero-content-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
        text-align: center;
    }

    .subtitle {
        font-size: 1.3rem;
    }

    .hero-description {
        font-size: 1rem;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-woman-img {
        max-width: 360px;
        border-radius: 12px;
    }

    .section-title {
        font-size: 2rem;
    }

    .subsection-title {
        font-size: 1.5rem;
    }
    
    .mission-text, .vision-text {
        font-size: 1rem;
    }

    .officers-grid {
        grid-template-columns: 1fr;
    }

    .company-info h2 {
        font-size: 2rem;
    }

    /* DE: "Unternehmensübersicht" (21 chars) — layout for max line ≈ 20ch (one char headroom), wrap instead of clip */
    html:lang(de) .section-title,
    html:lang(de) .company-info h2.section-title {
        max-width: 20ch;
        margin-left: auto;
        margin-right: auto;
        font-size: clamp(1.2rem, 4.2vw, 2rem);
        line-height: 1.25;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
        text-wrap: balance;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .navbar {
        padding: 0.4rem 0;
    }

    .logo-img {
        height: 45px;
    }


    .nav-menu {
        top: 55px;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .header-actions .login-button {
        padding: 0.34rem 0.5rem;
        font-size: 0.66rem;
        max-width: min(6.1rem, 28vw);
    }

    .hero-content {
        padding: 1rem;
    }

    .company-info {
        padding: 80px 0 50px;
    }

    .services {
        padding: 80px 0 50px;
    }

    .contact {
        padding: 80px 0 50px;
    }

    .officers-section {
        padding: 90px 0 70px;
    }

    .info-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 2rem 1.25rem;
    }

    .service-card .service-homecare-link {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }
}

/* Auth / Portal / Billing pages */
.auth-main {
    min-height: 100vh;
    padding: 120px 20px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f8f2;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.12);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    border: 1px solid rgba(76, 175, 80, 0.2);
}
.auth-card h1 {
    font-size: 1.35rem;
    color: #2E7D32;
    margin-bottom: 0.5rem;
}
.auth-desc {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1.5rem;
}
.auth-error {
    color: #c00;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    white-space: pre-line;
}
/* Apple「Hide My Email」案内（エラーではなく注意喚起） */
.apple-relay-guidance-card {
    max-width: 440px;
}
.apple-relay-guidance-title {
    font-size: 1.2rem;
    color: #2c3d2f;
    margin-bottom: 1rem;
    font-weight: 600;
}
.apple-relay-msg p {
    margin: 0.65rem 0 0;
    line-height: 1.65;
}
.apple-relay-msg p:first-child {
    margin-top: 0;
}
.apple-relay-back-btn {
    margin-top: 0.75rem;
    width: 100%;
    white-space: normal;
    line-height: 1.45;
}
.auth-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
}
.auth-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}
.auth-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(0.35);
}

.billing-consent-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}
.billing-consent-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
}
.billing-consent-item input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}
.billing-consent-item a {
    color: #1a4d7d;
    text-decoration: underline;
}

/* Portal: seat quantity stepper (− / input / ＋) — fixed button size, unified height */
.seat-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.seat-qty-stepper .seat-qty-btn {
    min-width: 2.75rem;
    width: 2.75rem;
    min-height: 2.5rem;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    border: none !important;
    border-radius: 0 !important;
    transform: none !important;
    box-shadow: none !important;
    font-size: 1.1rem;
    line-height: 1;
}
/* .auth-btn-secondary の枠線だけが残り外枠と二重になるのを防ぐ */
.seat-qty-stepper .seat-qty-btn.auth-btn-secondary {
    background: #f3f7f4;
    color: #2e7d32;
}
.seat-qty-stepper .seat-qty-btn.auth-btn-secondary:hover:not(:disabled) {
    background: #e8f0eb;
}
.seat-qty-stepper .seat-qty-btn:hover:not(:disabled) {
    transform: none !important;
    box-shadow: none !important;
    filter: brightness(0.97);
}
.seat-qty-stepper .seat-qty-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.seat-qty-stepper .seat-qty-input {
    width: 4.25rem;
    min-height: 2.5rem;
    box-sizing: border-box;
    padding: 0.35rem 0.35rem;
    font-size: 1.05rem;
    text-align: center;
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0;
    background: #fff;
    -moz-appearance: textfield;
    appearance: textfield;
}
.seat-qty-stepper .seat-qty-input::-webkit-outer-spin-button,
.seat-qty-stepper .seat-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.auth-login-list {
    display: grid;
    gap: 0.75rem;
}
.auth-btn-wrap {
    position: relative;
    display: block;
    width: 100%;
}
.auth-btn-wrap > .auth-btn {
    width: 100%;
}
.auth-last-used-badge {
    position: absolute;
    top: -0.4rem;
    right: 0.35rem;
    z-index: 2;
    display: inline-block;
    max-width: calc(100% - 0.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: #e8f0fe;
    color: #1a56db;
    border: 1px solid #c6d8ff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
    white-space: nowrap;
    pointer-events: none;
}
.auth-last-used-badge[hidden] {
    display: none !important;
}
.auth-last-used-badge--on-dark {
    background: #f9fafb;
    color: #111827;
    border-color: #e5e7eb;
}
@media (prefers-color-scheme: dark) {
    .auth-last-used-badge {
        background: #1e3a5f;
        color: #bfdbfe;
        border-color: #3b5998;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    }
    .auth-last-used-badge--on-dark {
        background: #f3f4f6;
        color: #111827;
        border-color: #d1d5db;
    }
}
@media (max-width: 480px) {
    .auth-last-used-badge {
        top: -0.3rem;
        right: 0.2rem;
        font-size: 0.58rem;
        padding: 0.15rem 0.38rem;
    }
}
.auth-social-btn,
.auth-mail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border-radius: 12px;
    padding: 0.82rem 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.auth-btn-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
}
.auth-social-google {
    background: #fff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}
.auth-social-google:hover:not(:disabled) {
    box-shadow: 0 6px 14px rgba(66, 133, 244, 0.2);
    transform: translateY(-1px);
}
.auth-social-apple {
    background: #101214;
    color: #fff;
    border: 1px solid #101214;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}
.auth-social-apple:hover:not(:disabled) {
    box-shadow: 0 6px 14px rgba(16, 18, 20, 0.3);
    transform: translateY(-1px);
}
.auth-mail-btn {
    background: linear-gradient(135deg, #3677f3 0%, #2359c4 100%);
    color: #fff;
    border: 1px solid #2359c4;
    box-shadow: 0 8px 20px rgba(54, 119, 243, 0.28);
}
.auth-mail-btn:hover:not(:disabled) {
    box-shadow: 0 10px 24px rgba(54, 119, 243, 0.35);
    transform: translateY(-1px);
}
.auth-mail-btn .auth-btn-icon {
    color: rgba(255, 255, 255, 0.95);
}
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.1rem 0;
    color: #7c7c7c;
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #d9e6da;
}
.auth-divider span {
    padding: 0 0.7rem;
}
.auth-email-form {
    margin-top: 0.25rem;
}
.auth-field-label {
    display: block;
    margin-bottom: 0.45rem;
    color: #2c3d2f;
    font-size: 0.92rem;
    font-weight: 600;
}
.auth-input {
    width: 100%;
    border: 1px solid #c7d9c9;
    border-radius: 10px;
    padding: 0.72rem 0.85rem;
    margin-bottom: 0.65rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.95rem;
}
.auth-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.18);
}
.auth-turnstile {
    min-height: 65px;
    margin-bottom: 0.8rem;
}
.auth-note {
    margin-top: 0.55rem;
    color: #4a4a4a;
    font-size: 0.86rem;
}
.auth-btn-secondary {
    margin-top: 0.6rem;
    background: #fff;
    color: #2E7D32;
    border: 1px solid #6fb374;
    box-shadow: none;
}
.auth-btn-secondary:hover:not(:disabled) {
    box-shadow: none;
    background: #f3fbf4;
}
.auth-back {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}
.auth-back a {
    color: #2E7D32;
    text-decoration: none;
}
.auth-back a:hover {
    text-decoration: underline;
}
.portal-section {
    margin-bottom: 1.5rem;
}
.portal-section h2 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
}
.portal-section p {
    font-size: 0.95rem;
    color: #555;
    margin: 0;
}

/* Portal page: wider, SaaS-style billing dashboard (extra top padding so title is not hidden by fixed header) */
.portal-main {
    min-height: 100vh;
    padding: 130px 24px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #f6f8fa;
}
.portal-card {
    width: 100%;
    max-width: 720px;
    min-width: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    border: none;
    overflow-wrap: break-word;
    word-break: break-word;
}
.portal-card .portal-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}
.portal-card #loading,
.portal-card .auth-desc {
    color: #57606a;
    font-size: 0.9375rem;
}
.portal-card .portal-section {
    margin-bottom: 1.25rem;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.portal-card .portal-section h2 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #57606a;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e6e8eb;
}
.portal-card .portal-section p {
    font-size: 0.9375rem;
    color: #24292f;
    margin-bottom: 0.5rem;
}
.portal-card .portal-section p:last-child {
    margin-bottom: 0;
}
.portal-card .portal-section strong {
    font-weight: 600;
    color: #24292f;
    min-width: min(10rem, 100%);
    display: inline-block;
    overflow-wrap: break-word;
    word-break: break-word;
}
.portal-card .portal-section .auth-btn {
    max-width: 16rem;
    width: auto;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 8px;
}
.portal-card .portal-section #referral-codes-list p {
    font-family: ui-monospace, monospace;
    font-size: 1rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.portal-card #section-status {
    padding: 1.5rem 1.5rem;
}
.portal-card #section-status p {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
    min-width: 0;
}
.portal-card #section-status strong {
    min-width: min(8rem, 40%);
    flex-shrink: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.portal-card #section-status span {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: break-word;
    word-break: break-word;
}
.portal-card #section-seats {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e6e8eb;
}
.portal-card .auth-back {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e6e8eb;
}
.portal-card #no-contract {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.portal-card #no-contract .auth-btn {
    width: 100%;
    max-width: none;
}
.portal-card #trial-seat-notice {
    border-radius: 8px;
    font-size: 0.875rem;
}
.portal-card #seat-input {
    border: 1px solid #e6e8eb;
    border-radius: 8px;
}
.portal-card #seat-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}
/* Referral: keep copy text area and button within section, balanced layout */
.portal-card #referral-code-block {
    max-width: 100%;
    box-sizing: border-box;
}
.portal-card #referral-code-block textarea {
    max-width: 100%;
    box-sizing: border-box;
}
.portal-card #referral-code-block .referral-copy-text-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.portal-card #referral-code-block .referral-copy-text-row textarea {
    flex: 1 1 100%;
    min-width: 0;
}
.portal-card #referral-code-block .referral-copy-text-row .auth-btn {
    flex-shrink: 0;
}

/* Portal mobile: avoid clipped labels/values (long DE strings) */
@media (max-width: 768px) {
    .portal-card .portal-page-title,
    .portal-card .auth-desc,
    .portal-card .portal-section,
    .portal-card .portal-section h2,
    .portal-card .portal-section p {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .portal-card #section-status p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .portal-card #section-status strong {
        min-width: 0;
        max-width: 100%;
    }

    .portal-card .portal-section strong {
        min-width: 0;
        max-width: 100%;
    }

    .portal-card #section-seats p {
        flex-wrap: wrap;
        min-width: 0;
    }

    .portal-card #no-contract .auth-btn,
    .portal-card .portal-section .auth-btn {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
    .auth-card {
        padding: 1.2rem;
    }
}

@media (min-width: 640px) {
    .portal-main {
        padding: 130px 32px 64px;
    }
    .portal-card .portal-section {
        padding: 1.5rem 1.75rem;
    }
}

