/* Updated: 2025-01-28 - Fixed client name font weight issue */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}



.user-info {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 18px;
    color: #667eea;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.user-info:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-toggle-icon {
    margin-left: 0.25rem;
    font-size: 0.85rem;
    color: #667eea;
    transition: transform 0.2s ease;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.logout-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.user-info.expanded .user-actions {
    max-height: 120px;
    opacity: 1;
}

.user-info.expanded .user-toggle-icon {
    transform: rotate(180deg);
}

.logout-btn:hover {
    background: #ff3742;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 71, 87, 0.3);
}

.password-change-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.password-change-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}



.login-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.main-container {
    flex: 1;
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
    gap: 2rem;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.sidebar-section {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-section:first-child {
    flex: 1;
}

.sidebar-section:last-child {
    flex: 0 0 auto;
    margin-bottom: 0;
    margin-top: auto;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

#measurementHistory {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 8px;
}

#measurementHistory::-webkit-scrollbar {
    width: 6px;
}

#measurementHistory::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

#measurementHistory::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

#measurementHistory::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}



.refresh-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    margin-left: 0.5rem;
}

.refresh-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.client-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0.75rem;
    margin: 0.2rem 0;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-height: 40px;
}

.client-item:hover {
    background: #f8f9fa;
    border-color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.client-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 24px;
}

.client-name {
    font-weight: 800;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

.client-type {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.1rem;
}

.client-capabilities {
    font-size: 0.75rem;
    color: #1a5f1a !important;
    margin-top: 0.15rem;
    line-height: 1.3;
    font-style: normal !important;
    background: rgba(46, 213, 115, 0.15) !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 4px !important;
    border: 1px solid rgba(46, 213, 115, 0.4) !important;
    display: block !important;
    font-weight: 600 !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100%;
    box-sizing: border-box;
}

/* 接続中テキストの特別なスタイル */
.client-item[data-client-type="接続中"] .client-name,
.client-item[data-client-type="connecting"] .client-name {
    color: #ffa502;
    font-weight: 800;
}

.client-item[data-client-type="接続中"] .client-status,
.client-item[data-client-type="connecting"] .client-status {
    color: #ffa502;
}

/* クライアントリストの空状態スタイル - 詳細度を上げて確実に適用 */
#clientList .client-item:only-child .client-info .client-name {
    color: #333 !important;
    /* グレーから通常の色に変更 */
    font-weight: 800 !important;
    /* より太いフォントウェイトに変更 */
    font-style: italic;
}

/* デバッグ用: クライアント名のフォントウェイトを強制設定 */
.client-name {
    font-weight: 800 !important;
    /* より太いフォントウェイトに変更 */
    font-family: 'Segoe UI', 'Arial', 'Helvetica', sans-serif !important;
}

.client-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    min-height: 24px;
    justify-content: flex-end;
    align-self: flex-start;
    margin-top: 0;
}

.client-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #1a5f1a;
    flex-shrink: 0;
}

.client-status-indicator.inactive {
    background-color: #ff4757;
}

.client-status-indicator.connecting {
    background-color: #ffa502;
    animation: pulse 1.5s infinite;
}

/* デバッグ用: clientList要素の可視性向上 */
#clientList {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px;
    min-height: 20px;
    overflow-y: auto;
}

#clientList::-webkit-scrollbar {
    width: 6px;
}

#clientList::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

#clientList::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

#clientList::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* クライアント能力表示のスタイル */
.client-capabilities {
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.4);
    color: #1a5f1a;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    margin-top: 0.15rem;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.3;
    font-style: normal;
    width: 100%;
    box-sizing: border-box;
}

.debug-tools button {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    margin: 2px !important;
    font-size: 12px !important;
    font-weight: bold !important;
}

.debug-tools button:nth-child(2) {
    background: #28a745 !important;
}

.debug-tools button:nth-child(3) {
    background: #007bff !important;
}

.debug-tools button:hover {
    opacity: 0.8 !important;
    transform: scale(1.05) !important;
    transition: all 0.2s ease !important;
}

.chat-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(102, 126, 234, 0.05);
}

.chat-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.chat-subtitle {
    color: #666;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-height: 0;
    transition: background-color 1s ease;
    background-color: rgba(255, 255, 255, 0.95);
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.message.assistant .message-avatar {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message.user .message-content {
    text-align: left;
}

.message-bubble {
    padding: 1rem 1.5rem;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.5;
    white-space: pre-line;
}

.message.user .message-bubble {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.assistant .message-bubble {
    background: rgba(102, 126, 234, 0.1);
    color: #333;
    border-bottom-left-radius: 5px;
}

/* 進行中のメッセージスタイル */
.message.assistant.thinking .message-bubble {
    background: rgba(102, 126, 234, 0.1);
    color: #333;
    border-bottom-left-radius: 5px;
    opacity: 0.8;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    background: rgba(102, 126, 234, 0.7);
    border-radius: 50%;
    animation: thinking 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes thinking {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.thinking-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ツールコールコンテナのスタイル */
.tool-call-container {
    margin: 0.5rem 0;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
}

.message.user .message-time {
    text-align: right;
}

.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.chat-input-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    min-height: 50px;
    max-height: 120px;
}

.chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 60px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.welcome-text {
    line-height: 1.6;
    margin-bottom: 2rem;
}

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

.feature-item {
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.feature-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.feature-desc {
    font-size: 0.9rem;
    color: #666;
}

.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #d63031;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.success-message {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid rgba(0, 184, 148, 0.3);
    color: #00b894;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.modal-text {
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 0.65rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

.form-status {
    min-height: 20px;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.form-status.success {
    color: #2e7d32;
}

.form-status.error {
    color: #c0392b;
}

.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    border-bottom-left-radius: 5px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* MCPツールコール表示 */
.tool-call {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 8px 0;
    overflow: hidden;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
}

.tool-call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f1f3f4;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tool-call-header:hover {
    background: #e8eaed;
}

.tool-call-icon {
    width: 16px;
    height: 16px;
    background: #5f6368;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    margin-right: 8px;
}

.tool-call-name {
    color: #202124;
    font-weight: 500;
    flex: 1;
}

.tool-call-toggle {
    color: #5f6368;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.tool-call.expanded .tool-call-toggle {
    transform: rotate(180deg);
}

.tool-call-content {
    display: none;
    padding: 12px;
}

.tool-call.expanded .tool-call-content {
    display: block;
}

.tool-call-section {
    margin-bottom: 12px;
}

.tool-call-section:last-child {
    margin-bottom: 0;
}

.tool-call-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-call-copy-btn {
    background: none;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.tool-call-copy-btn:hover {
    background: #e8eaed;
}

.tool-call-data {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #202124;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.tool-call-json-key {
    color: #1a73e8;
    font-weight: 500;
}

.tool-call-json-string {
    color: #137333;
}

.tool-call-json-number {
    color: #ea4335;
}

.tool-call-json-boolean {
    color: #f29900;
}

.tool-call-json-null {
    color: #9aa0a6;
}

/* モバイルファーストのレスポンシブデザイン */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: 100vh;
        padding: 1rem;
        gap: 1rem;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        flex-direction: column;
    }

    .chat-container {
        flex: 1;
        width: 100%;
        min-height: 0;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .auth-section {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .user-info {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }

    .logout-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
    }

    .feature-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chat-input-container {
        padding: 0.75rem;
    }

    .chat-input {
        font-size: 16px;
        /* iOSでズームを防ぐ */
        padding: 0.75rem;
        border-radius: 20px;
    }

    .send-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        font-size: 1.2rem;
    }

    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        border-radius: 15px;
    }

    .tool-call-container {
        margin: 0.5rem 0;
    }

    .tool-call-header {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .tool-call-content {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* スマホ（ポートレイト）専用の最適化 */
@media (max-width: 480px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .main-container {
        height: 100vh;
        overflow: hidden;
    }

    .chat-messages {
        padding: 0.5rem;
        flex: 1;
        min-height: 0;
    }

    .chat-input-container {
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
    }

    .chat-input-form {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .chat-input {
        flex: 1;
        min-height: 44px;
        /* タッチターゲットの最小サイズ */
        font-size: 16px;
        padding: 0.75rem 1rem;
        border-radius: 22px;
        border: 2px solid rgba(102, 126, 234, 0.2);
    }

    .send-btn {
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .message {
        margin: 0.5rem 0;
        gap: 0.5rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .message-bubble {
        padding: 0.75rem 1rem;
        border-radius: 18px;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .message.user .message-bubble {
        border-radius: 18px 18px 4px 18px;
    }

    .message.assistant .message-bubble {
        border-radius: 18px 18px 18px 4px;
    }

    .modal-content {
        width: 95%;
        margin: 0.5rem;
        padding: 1.5rem;
        border-radius: 15px;
    }

    .modal-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .modal-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 20px;
        min-height: 44px;
    }

    .welcome-message {
        padding: 1rem;
        margin: 1rem;
        border-radius: 15px;
    }

    .welcome-title {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .welcome-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .feature-list {
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .feature-item {
        padding: 1rem;
        border-radius: 12px;
    }

    .feature-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .feature-desc {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    /* タッチ操作の最適化 */
    .device-item {
        padding: 0.75rem;
        min-height: 44px;
        border-radius: 8px;
    }

    .device-item:hover {
        transform: none;
    }

    .device-item:active {
        transform: scale(0.98);
        background: rgba(102, 126, 234, 0.15);
    }

    /* スクロールの最適化 */
    .chat-messages::-webkit-scrollbar {
        width: 4px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    /* キーボード表示時の調整 */
    @media (max-height: 600px) {
        .chat-messages {
            flex: 1;
            min-height: 0;
        }
    }

    /* 横画面（ランドスケープ）対応 */
    @media (max-width: 480px) and (orientation: landscape) {
        .main-container {
            flex-direction: row;
        }

        .sidebar {
            width: 200px;
            height: 100vh;
            max-height: none;
            border-right: 1px solid rgba(255, 255, 255, 0.1);
            border-bottom: none;
        }

        .chat-container {
            width: calc(100% - 200px);
            height: 100vh;
            min-height: 0;
        }

        .chat-messages {
            flex: 1;
            min-height: 0;
        }
    }
}

/* 通知システム */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 320px;
    pointer-events: none;
}

.notification-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    padding: 16px;
    border-left: 4px solid;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.notification-card.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-card.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-title {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.notification-content {
    margin-bottom: 8px;
}

.notification-message {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.notification-progress {
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 100%;
    transform-origin: left;
    animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* 通知タイプ別スタイル */
.notification-success {
    border-left-color: #10b981;
}

.notification-info {
    border-left-color: #3b82f6;
}

.notification-warning {
    border-left-color: #f59e0b;
}

.notification-error {
    border-left-color: #ef4444;
}

.notification-analysis {
    border-left-color: #8b5cf6;
}

/* 優先度別スタイル */
.priority-high {
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.priority-medium {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.priority-low {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ガイダンス通知専用スタイル - WPFセンシング画面と統一 */
.notification-guidance {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1000px;
    min-height: 140px;
    padding: 35px 45px;
    margin: 0;
    border-radius: 25px;
    border: 3px solid #D4AC0D;
    /* 黄色のボーダー */
    background: #F1C40F;
    /* WPFと同じ黄色背景 */
    color: #2C3E50;
    /* 濃い青灰色のテキスト */
    z-index: 10000;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.3);
    animation: slideDownScale 0.4s ease-out;
    text-align: center;
    font-weight: 700;
}

.notification-guidance .notification-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.notification-guidance .notification-icon {
    font-size: 4.5rem;
    color: #2C3E50;
    /* 濃い青灰色 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-guidance .notification-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2C3E50;
    /* 濃い青灰色 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.notification-guidance .notification-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 2.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.notification-guidance .notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

.notification-guidance .notification-message {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2C3E50;
    /* 濃い青灰色 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
    margin: 0;
    padding: 0 25px;
}

.notification-guidance .notification-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin-top: 20px;
}

.notification-guidance .notification-progress-bar {
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    animation: progressBar 6s linear forwards;
}

@keyframes slideDownScale {
    from {
        transform: translateX(-50%) translateY(-100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
}

/* ガイダンス通知のタイプ別スタイル */
.notification-guidance.notification-info {
    border-top-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.notification-guidance.notification-success {
    border-top-color: #10b981;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification-guidance.notification-warning {
    border-top-color: #f59e0b;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification-guidance.notification-error {
    border-top-color: #ef4444;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* 継続表示ガイダンス通知のスタイル */
.notification-guidance_persistent {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1000px;
    min-height: 140px;
    padding: 35px 45px;
    margin: 0;
    border-radius: 25px;
    background: #F1C40F;
    /* 黄色背景（デフォルト） */
    border: 3px solid #D4AC0D;
    /* 黄色のボーダー（デフォルト） */
    color: #2C3E50;
    /* 濃い青灰色のテキスト */
    z-index: 10000;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    animation: slideDownScale 0.4s ease-out;
    text-align: center;
    font-weight: 700;
}

/* 継続表示ガイダンス通知（計測可能状態）のスタイル */
.notification-guidance_persistent.notification-success {
    background: #27AE60;
    /* 緑色背景 */
    border: 3px solid #229954;
    /* 緑色のボーダー */
    color: #FFFFFF;
    /* 白色のテキスト */
}

.notification-guidance_persistent .notification-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.notification-guidance_persistent .notification-icon {
    font-size: 4.5rem;
    color: inherit;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-guidance_persistent .notification-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: inherit;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.notification-guidance_persistent .notification-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: inherit;
    font-size: 2.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.notification-guidance_persistent .notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.notification-guidance_persistent .notification-message {
    font-size: 2.2rem;
    font-weight: 700;
    color: inherit;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
    margin: 0;
    padding: 0 25px;
}

.notification-guidance_persistent .notification-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin-top: 20px;
}

.notification-guidance_persistent .notification-progress-bar {
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    animation: progressBar 6s linear forwards;
}

/* 全画面計測中表示 */
.measurement-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: fadeIn 0.5s ease-in;
}

.measurement-fullscreen .measurement-header {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 60px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.measurement-fullscreen .measurement-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 3px;
}

.measurement-fullscreen .measurement-value {
    font-size: 6rem;
    font-weight: 900;
    text-align: center;
    color: #FFFFFF;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 4px;
    animation: pulse 2s ease-in-out infinite;
}

.measurement-fullscreen .measurement-guidance {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    min-height: 60px;
    padding: 20px 30px;
    background: #F1C40F;
    /* WPFと同じ黄色背景 */
    border: 3px solid #D4AC0D;
    /* 黄色のボーダー */
    border-radius: 15px;
    color: #2C3E50;
    /* 濃い青灰色のテキスト */
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.measurement-fullscreen .measurement-guidance.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* モバイル対応 */
@media (max-width: 768px) {
    .measurement-fullscreen .measurement-header {
        font-size: 2rem;
        margin-bottom: 40px;
        letter-spacing: 1px;
    }

    .measurement-fullscreen .measurement-title {
        font-size: 3rem;
        margin-bottom: 30px;
        letter-spacing: 2px;
    }

    .measurement-fullscreen .measurement-value {
        font-size: 4.5rem;
        letter-spacing: 3px;
    }

    .measurement-fullscreen .measurement-guidance {
        top: 15px;
        width: 95%;
        min-height: 50px;
        padding: 15px 20px;
        font-size: 1.2rem;
    }
}

/* 計測中通知専用スタイル - 右上に小さく表示 */
.notification-measurement_progress {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    min-height: 80px;
    padding: 20px;
    margin: 0;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease-out;
    text-align: left;
}

.notification-measurement_progress .notification-header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notification-measurement_progress .notification-icon {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.notification-measurement_progress .notification-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.notification-measurement_progress .notification-close {
    color: white;
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-measurement_progress .notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

.notification-measurement_progress .notification-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    margin: 0;
}

.notification-measurement_progress .notification-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 15px;
}

.notification-measurement_progress .notification-progress-bar {
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    animation: progressBar 3s linear forwards;
}

/* 計測完了通知専用スタイル - 右上に大きく表示 */
.notification-measurement_complete {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    min-height: 100px;
    padding: 25px;
    margin: 0;
    border-radius: 15px;
    border: none;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    z-index: 10000;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    animation: slideInRightScale 0.4s ease-out;
    text-align: left;
}

.notification-measurement_complete .notification-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.notification-measurement_complete .notification-icon {
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.notification-measurement_complete .notification-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.notification-measurement_complete .notification-close {
    color: white;
    font-size: 1.8rem;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-measurement_complete .notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

.notification-measurement_complete .notification-message {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.5;
    margin: 0;
}

.notification-measurement_complete .notification-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin-top: 20px;
}

.notification-measurement_complete .notification-progress-bar {
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    animation: progressBar 5s linear forwards;
}

@keyframes slideInRightScale {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* 計測結果通知専用スタイル - 右上に小さく表示 */
.notification-measurement_result {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    min-height: 80px;
    padding: 20px;
    margin: 0;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease-out;
    text-align: left;
}

.notification-measurement_result .notification-header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notification-measurement_result .notification-icon {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.notification-measurement_result .notification-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.notification-measurement_result .notification-close {
    color: white;
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-measurement_result .notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

.notification-measurement_result .notification-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    margin: 0;
}

.notification-measurement_result .notification-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 15px;
}

.notification-measurement_result .notification-progress-bar {
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    animation: progressBar 4s linear forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* モバイル対応 */
@media (max-width: 768px) {
    .notification-guidance {
        top: 10px;
        width: 95%;
        max-width: none;
        min-height: 100px;
        padding: 20px 25px;
        border-radius: 15px;
    }

    .notification-guidance .notification-icon {
        font-size: 3.5rem;
    }

    .notification-guidance .notification-title {
        font-size: 2rem;
    }

    .notification-guidance .notification-message {
        font-size: 1.8rem;
        padding: 0 15px;
        font-weight: 600;
    }

    .notification-guidance .notification-close {
        top: 10px;
        right: 15px;
        font-size: 2rem;
        width: 35px;
        height: 35px;
    }

    .notification-measurement_result {
        top: 10px;
        right: 10px;
        width: 280px;
        min-height: 70px;
        padding: 15px;
        border-radius: 10px;
    }

    .notification-measurement_result .notification-icon {
        font-size: 1.3rem;
    }

    .notification-measurement_result .notification-title {
        font-size: 1.1rem;
    }

    .notification-measurement_result .notification-message {
        font-size: 1rem;
    }

    .notification-measurement_result .notification-close {
        font-size: 1.3rem;
        width: 25px;
        height: 25px;
    }

    .notification-measurement_progress {
        top: 10px;
        right: 10px;
        width: 280px;
        min-height: 70px;
        padding: 15px;
        border-radius: 10px;
    }

    .notification-measurement_progress .notification-icon {
        font-size: 1.3rem;
    }

    .notification-measurement_progress .notification-title {
        font-size: 1.1rem;
    }

    .notification-measurement_progress .notification-message {
        font-size: 1rem;
    }

    .notification-measurement_progress .notification-close {
        font-size: 1.3rem;
        width: 25px;
        height: 25px;
    }

    .notification-measurement_complete {
        top: 10px;
        right: 10px;
        width: 320px;
        min-height: 90px;
        padding: 20px;
        border-radius: 12px;
    }

    .notification-measurement_complete .notification-icon {
        font-size: 1.8rem;
    }

    .notification-measurement_complete .notification-title {
        font-size: 1.2rem;
    }

    .notification-measurement_complete .notification-message {
        font-size: 1.1rem;
    }

    .notification-measurement_complete .notification-close {
        font-size: 1.6rem;
        width: 30px;
        height: 30px;
    }

    .notification-container {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .notification-card {
        margin-bottom: 8px;
        padding: 12px;
    }

    .notification-message {
        font-size: 0.85rem;
    }
}

/* 超小型デバイス対応 */
@media (max-width: 360px) {
    .header {
        padding: 0.5rem;
    }

    .logo {
        font-size: 1rem;
    }

    .chat-input {
        font-size: 16px;
        padding: 0.5rem 0.75rem;
    }

    .message-bubble {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .modal-content {
        padding: 1rem;
    }
}

/* 全画面計測表示のガイダンス色設定 */
#measurement-guidance.guidance-success {
    background-color: #27AE60 !important;
    color: white !important;
    border: 2px solid #27AE60 !important;
}

#measurement-guidance.guidance-warning {
    background-color: #F1C40F !important;
    color: #2C3E50 !important;
    border: 2px solid #F1C40F !important;
}

/* 派手な分析結果表示用スタイル */
.spectacular-analysis-result {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: spectacularEntrance 1s ease-out;
    border: 3px solid #FFD700;
    position: relative;
    overflow: hidden;
}

.spectacular-analysis-result::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: spectacularShine 3s infinite;
}

.spectacular-analysis-result .header {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.spectacular-analysis-result .measurement-value {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    margin: 15px 0;
    border: 2px solid #FFD700;
    animation: spectacularPulse 2s infinite;
}

.spectacular-analysis-result .analysis-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    line-height: 1.6;
}

.spectacular-analysis-result .footer {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* アニメーション定義 */
@keyframes spectacularEntrance {
    0% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.05) rotate(2deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes spectacularShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes spectacularPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
}

/* 全画面派手な分析結果表示 */
.spectacular-analysis-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spectacularFullscreenEntrance 1s ease-out;
}

.spectacular-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    opacity: 0.95;
    animation: spectacularOverlayPulse 3s infinite;
}

.spectacular-content {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 4px solid #FFD700;
    animation: spectacularContentFloat 2s ease-in-out infinite alternate;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.spectacular-header {
    margin-bottom: 30px;
}

.celebration-text {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: spectacularTextBounce 1.5s ease-in-out infinite;
    margin-bottom: 10px;
}

.celebration-subtitle {
    font-size: 1.5em;
    color: #764ba2;
    font-weight: 600;
}

.spectacular-measurement {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    animation: spectacularMeasurementGlow 2s ease-in-out infinite alternate;
}

.measurement-label {
    font-size: 1.8em;
    color: #2C3E50;
    font-weight: bold;
    margin-bottom: 15px;
}

.measurement-value {
    font-size: 6em;
    font-weight: 900;
    color: #2C3E50;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: spectacularValuePulse 1.5s ease-in-out infinite;
}

.measurement-value .unit {
    font-size: 0.4em;
    color: #E74C3C;
    font-weight: 700;
}

.spectacular-analysis {
    margin: 40px 0;
    text-align: left;
}

.analysis-label {
    font-size: 1.8em;
    color: #667eea;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.analysis-content {
    background: rgba(102, 126, 234, 0.1);
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
    min-height: 100px;
}

.analysis-sentence {
    font-size: 1.3em;
    line-height: 1.8;
    color: #2C3E50;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spectacular-footer {
    margin-top: auto;
    padding-top: 20px;
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 2px solid #FFD700;
}

.completion-text {
    font-size: 2em;
    font-weight: bold;
    color: #27AE60;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: spectacularCompletionPulse 2s ease-in-out infinite;
    margin-bottom: 15px;
}

.close-hint {
    font-size: 1.2em;
    color: #7F8C8D;
    font-style: italic;
    cursor: pointer;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 10px;
}

.close-hint:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* 大画面ではモバイル用ヘッダーを隠す */
.mobile-header {
    display: none;
}

.mobile-menu {
    display: none;
}

.mobile-menu-overlay {
    display: none;
}

/* 小さい画面対応 */
@media (max-width: 1024px) {

    /* 大画面用ヘッダーを隠す */
    .header {
        display: none;
    }

    /* サイドバーを隠す */
    .sidebar {
        display: none;
    }

    /* モバイル用ヘッダーを表示 */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 50px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        z-index: 1000;
    }

    .mobile-menu {
        display: block;
        position: fixed;
        top: 50px;
        left: -300px;
        width: 300px;
        height: calc(100vh - 50px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        border-right: 1px solid rgba(0, 0, 0, 0.1);
    }

    .mobile-menu.active {
        left: 0;
    }

    .mobile-menu-content {
        padding: 20px;
    }

    .mobile-menu-section {
        margin-bottom: 30px;
    }

    .mobile-menu-section h3 {
        font-size: 1.1rem;
        color: #333;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #667eea;
    }

    /* モバイルメニュー内の使用量表示 */
    .mobile-usage-gauge-container {
        padding: 15px;
        background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(135, 206, 235, 0.1));
        border-radius: 12px;
        border: 2px solid #FFB6C1;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-usage-gauge-container .usage-gauge {
        position: relative;
        margin-bottom: 8px;
    }

    .mobile-usage-gauge-container .usage-gauge-track {
        width: 100%;
        height: 10px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 5px;
        overflow: hidden;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(135, 206, 235, 0.3);
    }

    .mobile-usage-gauge-container .usage-progress {
        height: 100%;
        background: linear-gradient(90deg, #98FB98, #FFD700, #FFB6C1);
        border-radius: 5px;
        transition: width 0.6s ease-out;
    }

    .mobile-usage-gauge-container .usage-gauge-text {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        margin-top: 8px;
        font-size: 0.85rem;
        font-weight: bold;
    }

    .mobile-usage-gauge-container .usage-text {
        color: #FFB6C1;
        font-size: 1rem;
    }

    .mobile-usage-gauge-container .usage-gauge-separator {
        color: #666;
        font-size: 0.9rem;
    }

    .mobile-usage-gauge-container .usage-gauge-limit {
        color: #87CEEB;
        font-size: 1rem;
    }

    .mobile-usage-gauge-container .usage-gauge-info {
        text-align: center;
        margin-top: 6px;
    }

    .mobile-usage-gauge-container .limit-text {
        font-size: 0.8rem;
        color: #666;
        font-weight: 500;
    }

    .mobile-menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-logo {
        display: none;
    }

    /* モバイルヘッダーのキャラクター情報 */
    .mobile-character-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        justify-content: center;
    }

    .mobile-character-avatar {
        position: relative;
        width: 35px;
        height: 35px;
        border-radius: 50%;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        border: 2px solid #FFB6C1;
        background: linear-gradient(135deg, #FFB6C1, #87CEEB);
        flex-shrink: 0;
    }

    .mobile-character-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-character-vrm-viewer {
        width: 100%;
        height: 100%;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 50%;
        overflow: hidden;
    }

    .mobile-character-avatar.has-vrm img {
        display: none;
    }

    .mobile-character-loading {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #666;
    }

    .mobile-character-name {
        font-size: 0.9rem;
        font-weight: bold;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    .mobile-menu-button {
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        padding: 0;
    }

    .mobile-menu-button span {
        width: 20px;
        height: 2px;
        background: #333;
        margin: 2px 0;
        transition: 0.3s;
    }

    .mobile-menu-button.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .mobile-menu-button.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-button.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .mobile-user-button {
        width: 40px;
        height: 40px;
        background: linear-gradient(45deg, #667eea, #764ba2);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {

    .mobile-menu-button {
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        padding: 0;
    }

    .mobile-menu-button span {
        width: 20px;
        height: 2px;
        background: #333;
        margin: 2px 0;
        transition: 0.3s;
    }

    .mobile-menu-button.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .mobile-menu-button.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-button.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .mobile-user-button {
        width: 40px;
        height: 40px;
        background: linear-gradient(45deg, #667eea, #764ba2);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* モバイルメニュー */
    .mobile-menu {
        position: fixed;
        top: 50px;
        left: -300px;
        width: 300px;
        height: calc(100vh - 50px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        border-right: 1px solid rgba(0, 0, 0, 0.1);
    }

    .mobile-menu.active {
        left: 0;
    }

    .mobile-menu-content {
        padding: 20px;
    }

    .mobile-menu-section {
        margin-bottom: 30px;
    }

    .mobile-menu-section h3 {
        font-size: 1.1rem;
        color: #333;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #667eea;
    }

    /* モバイルメニュー内の使用量表示 */
    .mobile-usage-gauge-container {
        padding: 15px;
        background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(135, 206, 235, 0.1));
        border-radius: 12px;
        border: 2px solid #FFB6C1;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-usage-gauge-container .usage-gauge {
        position: relative;
        margin-bottom: 8px;
    }

    .mobile-usage-gauge-container .usage-gauge-track {
        width: 100%;
        height: 10px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 5px;
        overflow: hidden;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(135, 206, 235, 0.3);
    }

    .mobile-usage-gauge-container .usage-progress {
        height: 100%;
        background: linear-gradient(90deg, #98FB98, #FFD700, #FFB6C1);
        border-radius: 5px;
        transition: width 0.6s ease-out;
    }

    .mobile-usage-gauge-container .usage-gauge-text {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        margin-top: 8px;
        font-size: 0.85rem;
        font-weight: bold;
    }

    .mobile-usage-gauge-container .usage-text {
        color: #FFB6C1;
        font-size: 1rem;
    }

    .mobile-usage-gauge-container .usage-gauge-separator {
        color: #666;
        font-size: 0.9rem;
    }

    .mobile-usage-gauge-container .usage-gauge-limit {
        color: #87CEEB;
        font-size: 1rem;
    }

    .mobile-usage-gauge-container .usage-gauge-info {
        text-align: center;
        margin-top: 6px;
    }

    .mobile-usage-gauge-container .limit-text {
        font-size: 0.8rem;
        color: #666;
        font-weight: 500;
    }

    .mobile-client-item {
        display: flex;
        align-items: center;
        padding: 10px;
        margin-bottom: 8px;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 8px;
        border-left: 4px solid #667eea;
    }

    .mobile-client-name {
        font-weight: 600;
        color: #333;
        margin-right: 10px;
    }

    .mobile-client-status {
        font-size: 0.9rem;
        color: #666;
    }

    .mobile-status-dot {
        width: 8px;
        height: 8px;
        background: #1a5f1a;
        border-radius: 50%;
        margin-right: 8px;
    }

    .mobile-auth-section {
        padding: 15px;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 10px;
        text-align: center;
    }

    .mobile-logout-button {
        background: #E74C3C;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 20px;
        font-size: 0.9rem;
        cursor: pointer;
        width: 100%;
        margin-top: 10px;
    }

    .mobile-password-button {
        background: linear-gradient(45deg, #667eea, #764ba2);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 20px;
        font-size: 0.9rem;
        cursor: pointer;
        width: 100%;
        margin-top: 10px;
    }

    .mobile-login-button {
        background: #667eea;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 20px;
        font-size: 0.9rem;
        cursor: pointer;
        width: 100%;
    }

    /* オーバーレイ */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* メインコンテンツを全幅に */
    .main-content {
        flex-direction: column;
        width: 100%;
    }

    .chat-container {
        width: 100%;
        height: 100vh;
        margin: 0;
        padding: 0;
        margin-top: 50px;
        /* モバイルヘッダーの高さ分 */
    }

    .chat-messages {
        height: calc(100vh - 130px);
        /* ヘッダー50px + 入力欄80px */
        padding: 10px;
    }

    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .chat-input {
        width: calc(100% - 80px);
        margin-right: 10px;
    }

    .send-button {
        width: 60px;
    }

    /* 派手な分析結果表示のモバイル対応 */
    .spectacular-content {
        padding: 20px;
        margin: 10px;
        max-width: 95%;
    }

    .celebration-text {
        font-size: 2em;
    }

    .celebration-subtitle {
        font-size: 1.2em;
    }

    .measurement-value {
        font-size: 4em;
    }

    .measurement-label {
        font-size: 1.4em;
    }

    .analysis-label {
        font-size: 1.4em;
    }

    .analysis-sentence {
        font-size: 1.1em;
    }

    .completion-text {
        font-size: 1.5em;
    }

    .close-hint {
        font-size: 1em;
        padding: 15px 25px;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {

    /* ヘッダーを隠す */
    .header {
        display: none;
    }

    /* サイドバーを隠す */
    .sidebar {
        display: none;
    }

    /* メインコンテンツを全幅に */
    .main-content {
        flex-direction: column;
        width: 100%;
    }

    .chat-container {
        width: 100%;
        height: 100vh;
        margin: 0;
        padding: 0;
        margin-top: 50px;
        /* モバイルヘッダーの高さ分 */
    }

    .chat-messages {
        height: calc(100vh - 120px);
        /* ヘッダー50px + 入力欄70px */
        padding: 8px;
    }

    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .chat-input {
        width: calc(100% - 70px);
        margin-right: 8px;
        font-size: 16px;
        /* iOS Safari のズーム防止 */
    }

    .send-button {
        width: 55px;
        font-size: 14px;
    }

    /* 派手な分析結果表示のモバイル対応 */
    .spectacular-content {
        padding: 15px;
        margin: 5px;
        max-width: 98%;
    }

    .celebration-text {
        font-size: 1.8em;
    }

    .celebration-subtitle {
        font-size: 1em;
    }

    .measurement-value {
        font-size: 3em;
    }

    .measurement-label {
        font-size: 1.2em;
    }

    .analysis-label {
        font-size: 1.2em;
    }

    .analysis-sentence {
        font-size: 1em;
    }

    .completion-text {
        font-size: 1.3em;
    }

    .close-hint {
        font-size: 0.9em;
        padding: 12px 20px;
        margin-top: 15px;
    }
}

/* 全画面表示用アニメーション */
@keyframes spectacularFullscreenEntrance {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spectacularOverlayPulse {

    0%,
    100% {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    }

    50% {
        background: linear-gradient(135deg, #f093fb 0%, #667eea 50%, #764ba2 100%);
    }
}

@keyframes spectacularContentFloat {
    0% {
        transform: translateY(0px);
    }

    100% {
        transform: translateY(-10px);
    }
}

@keyframes spectacularTextBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes spectacularMeasurementGlow {
    0% {
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    }

    100% {
        box-shadow: 0 15px 40px rgba(255, 215, 0, 0.6);
    }
}

@keyframes spectacularValuePulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
    }
}

@keyframes spectacularCompletionPulse {

    0%,
    100% {
        transform: scale(1);
        color: #27AE60;
    }

    50% {
        transform: scale(1.1);
        color: #2ECC71;
    }
}

@keyframes spectacularFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* モバイルキーボード非表示時のスタイル調整 */
@media (max-width: 768px) {

    /* キーボード非表示時のチャットコンテナの高さ調整 */
    .chat-container.keyboard-hidden {
        height: calc(100vh - 60px) !important;
        transition: height 0.3s ease;
    }

    /* キーボード非表示時のチャットメッセージエリアの高さ調整 */
    .chat-messages.keyboard-hidden {
        height: calc(100vh - 140px) !important;
        transition: height 0.3s ease;
    }

    /* キーボード非表示時の入力エリアの調整 */
    .chat-input-container.keyboard-hidden {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        padding: 10px;
        z-index: 1000;
    }

    /* キーボード非表示時のビューポート調整 */
    body.keyboard-hidden {
        height: 100vh;
        overflow: hidden;
    }

    /* キーボード非表示時のスクロール調整 */
    .chat-messages.keyboard-hidden {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* フッター */
/* フッターは削除されました */
.app-footer {
    display: none;
    padding: 0.5rem 2rem;
    position: sticky;
    bottom: 0;
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left,
.footer-right,
.footer-center {
    display: flex;
    align-items: center;
}

.footer-center {
    justify-content: center;
    flex: 1;
}

.footer-text {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.footer-text:first-child {
    color: #333;
    font-weight: 600;
}

/* モバイル用フッター調整 */
@media (max-width: 768px) {
    .app-footer {
        padding: 0.4rem 1rem;
    }

    .footer-text {
        font-size: 0.7rem;
    }

    .footer-content {
        justify-content: center;
    }

    .footer-center {
        justify-content: center;
    }
}

/* クライアント詳細ポップアップ */
.client-detail-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.client-detail-popup.show {
    opacity: 1;
    visibility: visible;
}

.client-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.client-detail-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.client-detail-popup.show .client-detail-content {
    transform: scale(1) translateY(0);
}

.client-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.client-detail-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.client-detail-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.client-detail-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.client-detail-body {
    padding: 2rem;
}

.client-detail-section {
    margin-bottom: 2rem;
}

.client-detail-section:last-child {
    margin-bottom: 0;
}

.client-detail-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.client-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.client-detail-label {
    font-weight: 500;
    color: #666;
    min-width: 120px;
}

.client-detail-value {
    color: #333;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

.client-detail-value .client-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.client-detail-value .client-status-indicator.active {
    background: #1a5f1a;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .client-detail-content {
        width: 95%;
        max-height: 90vh;
    }

    .client-detail-header {
        padding: 1rem 1.5rem;
    }

    .client-detail-header h3 {
        font-size: 1.1rem;
    }

    .client-detail-body {
        padding: 1.5rem;
    }

    .client-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .client-detail-label {
        min-width: auto;
        font-size: 0.9rem;
    }

    .client-detail-value {
        text-align: left;
        margin-left: 0;
        font-size: 0.9rem;
    }
}

/* モバイル版測定履歴スタイル */
.mobile-measurement-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-measurement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mobile-measurement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mobile-measurement-type {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.mobile-measurement-value {
    font-weight: bold;
    color: #667eea;
    font-size: 16px;
}

.mobile-measurement-date {
    font-size: 12px;
    color: #666;
}

/* モバイル版詳細ポップアップスタイル */
.mobile-detail-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-detail-popup.show {
    opacity: 1;
    visibility: visible;
}

.mobile-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.mobile-detail-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.mobile-detail-popup.show .mobile-detail-content {
    transform: scale(1) translateY(0);
}

.mobile-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.mobile-detail-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.mobile-detail-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mobile-detail-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-detail-body {
    padding: 2rem;
}

.mobile-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.mobile-detail-label {
    font-weight: 500;
    color: #666;
    min-width: 120px;
}

.mobile-detail-value {
    color: #333;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

/* モバイル版クライアントアイテムのタップ対応 */
.mobile-client-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-client-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(4px);
}

/* モバイル版アドバイス表示スタイル */
.mobile-detail-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.mobile-detail-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.mobile-advice-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}

.mobile-advice-content br {
    margin-bottom: 0.5rem;
}

/* ファイル添付機能のスタイル */
.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex: 1;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-attach-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.file-attach-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
}

.file-attach-btn:active {
    transform: translateY(0);
}

.file-attach-area {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.file-attach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.file-attach-title {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.file-attach-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-attach-close:hover {
    background: #dee2e6;
    color: #495057;
}

.file-attach-content {
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 4px;
    color: #6c757d;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.file-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: #f8d7da;
}

.drag-drop-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed #667eea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.drag-drop-content {
    text-align: center;
    color: #667eea;
}

.drag-drop-content svg {
    margin-bottom: 1rem;
}

.drag-drop-content p {
    margin: 0.5rem 0;
    font-weight: 500;
}

.drag-drop-hint {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ファイル添付エリアのアニメーション */
.file-attach-area {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .input-wrapper {
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        gap: 0.5rem;
    }

    .input-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .file-attach-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .file-attach-area {
        margin-top: 0.75rem;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .file-actions {
        align-self: flex-end;
    }
}

/* より小さなモバイル画面での最適化 */
@media (max-width: 480px) {
    .input-wrapper {
        gap: 0.25rem;
    }

    .input-actions {
        gap: 0.25rem;
    }

    .file-attach-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }

    .send-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }
}

/* 感情レベルエフェクト */
.emotion-effect-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.emotion-effect-overlay.active {
    opacity: 1;
}

.emotion-particle {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    animation: particleFloat 2s ease-out forwards;
    opacity: 0;
}

.emotion-particle-positive {
    animation: particleFloatPositive 2.5s ease-out forwards;
    font-size: 2rem;
}

.emotion-particle-neutral {
    animation: particleFloatNeutral 2.5s ease-out forwards;
    font-size: 1.5rem;
}

.emotion-particle-negative {
    animation: particleFloatNegative 2s ease-out forwards;
    font-size: 1.2rem;
    opacity: 0.6;
}

@keyframes particleFloatPositive {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5) rotate(0deg);
    }

    10% {
        opacity: 1;
        transform: translate(0, -10px) scale(1) rotate(180deg);
    }

    90% {
        opacity: 1;
        transform: translate(var(--end-x, 20px), var(--end-y, -80px)) scale(1.2) rotate(360deg);
    }

    100% {
        opacity: 0;
        transform: translate(var(--end-x, 20px), var(--end-y, -100px)) scale(0.5) rotate(450deg);
    }
}

@keyframes particleFloatNeutral {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }

    10% {
        opacity: 0.8;
        transform: translate(0, -5px) scale(1);
    }

    90% {
        opacity: 0.8;
        transform: translate(var(--end-x, 15px), var(--end-y, -60px)) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--end-x, 15px), var(--end-y, -80px)) scale(0.5);
    }
}

@keyframes particleFloatNegative {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }

    10% {
        opacity: 0.5;
        transform: translate(0, -5px) scale(0.9);
    }

    90% {
        opacity: 0.5;
        transform: translate(var(--end-x, 10px), var(--end-y, -40px)) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--end-x, 10px), var(--end-y, -60px)) scale(0.5);
    }
}

/* 選択肢ボタンのスタイル */
.choice-buttons-container {
    display: flex;
    flex-direction: column;
    /* 縦方向に変更 */
    gap: 10px;
    padding: 15px;
    margin-top: 0;
    /* マージンを削除 */
    flex-wrap: nowrap;
    /* 折り返しなし */
    align-items: flex-start;
    max-width: 400px;
    /* 最大幅を300pxから400pxに拡大して改行を防ぐ */
    flex: 0 0 auto;
    /* 固定サイズ */
    align-self: flex-start;
    /* 上揃え */
}

.choice-button {
    padding: 12px 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-size: 1.2rem;
    /* 1.1rem → 1.2rem（約19.2px）に変更してPCサイズでさらに大きく */
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 44px;
    width: 100%;
    /* 幅を100%に */
    min-width: 200px;
    /* 最小幅を設定 */
    text-align: left;
    /* 左揃えに変更 */
    white-space: normal;
    /* 折り返しを許可 */
    overflow: visible;
    /* オーバーフローを表示 */
    text-overflow: clip;
    /* テキストオーバーフローをクリップ */
    max-width: 100%;
    /* ゆっくり明滅するアニメーション */
    animation: choiceButtonPulse 2s ease-in-out infinite;
}

/* ゆっくり明滅するアニメーション */
@keyframes choiceButtonPulse {
    0% {
        opacity: 1;
        background: white;
        border-color: #667eea;
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }

    50% {
        opacity: 1;
        background: #fff9e6;
        border-color: #ffb84d;
        color: #667eea;
        box-shadow: 0 0 0 6px rgba(255, 184, 77, 0.15), 0 2px 8px rgba(255, 184, 77, 0.2);
        transform: scale(1.01);
    }

    100% {
        opacity: 1;
        background: white;
        border-color: #667eea;
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.choice-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    /* ホバー時はアニメーションを停止 */
    animation: none;
}

.choice-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    /* フォーカス時もアニメーションを停止 */
    animation: none;
}

.choice-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
    /* クリック時もアニメーションを停止 */
    animation: none;
}

/* モバイル対応 */
@media (max-width: 768px) {

    /* モバイル時はcharacter-areaが非表示のため、選択肢はoutput-character-area内に表示 */
    .character-area .choice-buttons-container {
        display: none;
        /* character-area内の選択肢を非表示 */
    }

    /* output-character-area内に選択肢を表示（JavaScriptで動的に追加される場合に備えて） */
    .output-character-area .choice-buttons-container {
        display: flex;
        flex-direction: column;
        padding: 10px;
        gap: 8px;
        margin-top: 0;
        max-width: calc(100% - 220px);
        /* アバター幅(200px) + gap(15px) + 余白を考慮 */
        flex: 0 0 auto;
        align-self: flex-start;
    }

    .choice-button {
        width: 100%;
        min-width: auto;
        white-space: normal;
        text-overflow: clip;
        font-size: 1rem;
        /* モバイルでも読みやすいサイズに */
    }

    /* PCサイズでの選択肢コンテナの最大幅を拡大 */
    @media (min-width: 769px) {
        .choice-buttons-container {
            max-width: 400px;
            /* PCサイズでは400pxに拡大 */
        }

        .choice-button {
            font-size: 1.2rem;
            /* PCサイズでは1.2remに拡大 */
        }
    }
}