/* 共通スタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ビューポートの設定を確実にする */
@viewport {
    width: device-width;
    initial-scale: 1;
}

/* 印刷時のスタイル */
@media print {
    body * {
        visibility: hidden;
    }
    .qrcode-container, .qrcode-container * {
        visibility: visible;
    }
    .qrcode-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .qrcode-actions {
        display: none;
    }
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    position: relative;
    max-width: calc(100vw - 100px);
    width: 100%;
    display: block;
    margin: 0 auto;
    padding: 50px 0;
}
@media (max-width: 768px) {
    .container {
        max-width: calc(100vw - 10px);
        padding: 5px 0;
    }
}
h1 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    .container {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
}

/* フォーム関連 */
fieldset {
    padding: 10px;
}
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* QRコード読み取りページのスタイル */
.format-info {
    margin: 15px 0;
}

.file-format-note {
    font-weight: bold;
    color: #0056b3;
}

.format-details {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 3px solid #17a2b8;
}

details {
    margin: 10px 0;
    cursor: pointer;
}

summary {
    color: #17a2b8;
    font-weight: 500;
}

.help-text {
    margin-top: 10px;
    text-align: center;
    font-style: italic;
    color: #6c757d;
}

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 15px;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px; /* iOSでフォームのフォントサイズが小さいと自動的にズームする問題を防止 */
        padding: 12px 10px;
    }
      fieldset {
        padding: 10px;
        margin-bottom: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* 横方向のはみ出しを防止 */
    }
    
    legend {
        font-size: 16px;
        padding: 0 5px;
        width: auto;
        max-width: 95%; /* 長すぎる場合は切り詰める */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .radio-label {
        padding: 8px 0;
        display: flex;
        align-items: center;
    }
    
    .radio-label input[type="radio"] {
        margin-right: 8px;
        min-width: 20px;
        min-height: 20px;
    }
}

/* 必須項目 */
.required {
    color: #e74c3c;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.form-actions button {
    margin-right: 10px;
}

.form-actions button:last-child {
    margin-right: 0;
}

/* ボタン関連 */
.btn {
    display: inline-block;
    padding: 10px 15px;
    border: none;
    background-color: #3498db;
    color: white;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-block {
    width: 100%;
    display: block;
    padding: 12px 15px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .btn {
        padding: 12px 15px;
        font-size: 15px;
        width: 100%;
        margin-bottom: 5px;
    }
}

.btn-primary {
    background-color: #3498db;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.view-qr-btn {
    width: 100%;
    background-color: #545251;
}

.view-qr-btn:hover {
    background-color: #3d3c3b;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

/* テーブル関連 */
.product-table {
    width: 100%;
    margin-bottom: 30px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid;
    border-radius: 10px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

.product-table th,
.product-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    text-align: center;
    border: 1px solid;
    min-width: 70px;
    vertical-align: middle;
    word-break: break-all;
}

.product-table th {
    background-color: #F6F4DD;
    font-weight: bold;
    color: #2c3e50;
    white-space: nowrap;
}

.product-table td {
    text-align: center;
}
@media screen and (min-width: 769px) {/* PC用 */
    .product-table td[data-label="製品名"] {
        text-align: left;
    }
}
.sort-btn {
    color: #0275d8;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
}

.sort-btn:hover {
    background: #e9ecef;
    text-decoration: underline;
}

.product-table tr:hover {
    background-color: #f9f9f9;
}

.product-table th.blue-cell {
    background: #D4E9F2;
}

.product-table th.gray-cell {
    background: #F5F6F6;
}

/* レスポンシブテーブル */
@media (max-width: 768px) {
    .product-table {
        border: 0;
        width: 100%;
        background: none;
        border-radius: inherit;
        box-shadow: none;
    }
    
    .product-table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }
    
    .product-table tr {
        display: block;
        margin-bottom: 20px;
        background: #fff;
    }
    
    .product-table td {
        border-bottom: 1px solid #ddd;
        display: block;
        font-size: 15px;
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    
    .product-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-align: left;
    }
    
    .product-table td:last-child {
        border-bottom: 5px solid #ddd;
    }
}

/* アラート関連 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* リンク関連 */
.links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.links .btn {
    margin: 0;
}

@media (max-width: 768px) {
    .links {
        flex-direction: column;
        align-items: stretch;
    }
    
    .links .btn {
        display: block;
        margin-bottom: 8px;
        text-align: center;
    }
}

/* QRコード関連 */
.qrcode-container {
    margin: 30px 0;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.qrcode-image {
    display: block;
    margin: 20px auto;
    max-width: 200px;
    height: auto;
}

.qrcode-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .qrcode-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .qrcode-image {
        max-width: 180px;
    }
    
    .qrcode-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .qrcode-container h3 {
        font-size: 18px;
    }
    
    /* 印刷時のQRコード最適化 */
    @media print {
        .qrcode-image {
            max-width: 300px;
        }
    }
    
    /* 使い方セクション・代替方法のモバイル最適化 */
    .usage-instructions, .alternative-method {
        padding: 12px;
        margin-top: 15px;
        text-align: left;
    }
    
    .usage-instructions h3, .alternative-method h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .usage-instructions ol, .alternative-method ol {
        margin-left: 15px;
        padding-left: 5px;
    }
    
    .usage-instructions li, .alternative-method li {
        margin-bottom: 8px;
    }
}

/* QRコード設定フォーム */
.qrcode-settings {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* 説明セクション */
.usage-instructions {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
    text-align: left;
}

.usage-instructions h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.usage-instructions ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

/* 代替方法セクション */
.alternative-method {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
}

.alternative-method h4 {
    color: #856404;
    margin-bottom: 10px;
}

.alternative-method p {
    margin-bottom: 10px;
}

.qrcode-view {
    margin: 20px 0;
    text-align: center;
}

/* チェックボックス関連 */
.checkbox-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
}

.checkbox-group .help-text {
    flex-basis: 100%;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

/* ラジオボタングループ */
.radio-group {
    margin-bottom: 15px;
}

.radio-label {
    display: block;
    margin-bottom: 10px;
    font-weight: normal;
}

/* インストール手順のスタイル */
.install-steps {
    margin: 20px 0;
    padding-left: 20px;
}

/* フォーマット選択器 */
.format-selector {
    margin-bottom: 20px;
    text-align: center;
}

.format-selector a {
    margin-right: 10px;
    padding: 8px 12px;
}

.format-selector a.active {
    background-color: #3498db;
    color: white;
}

/* サンプルデータ表示 */
.sample-data {
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

/* QRコードテスト用コンテナ */

/* モバイルデバイスの全体的なレスポンシブ対応 */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 10px;
    }
    
    /* テーブルのデータラベル設定 */
    .product-table td:nth-of-type(1)::before { content: "製品名"; }
    .product-table td:nth-of-type(2)::before { content: "使用期限"; }
    .product-table td:nth-of-type(3)::before { content: "期限10日前通知"; }
    .product-table td:nth-of-type(4)::before { content: "表示テキスト"; }
    .product-table td:nth-of-type(5)::before { content: "備考"; }
    .product-table td:nth-of-type(6)::before { content: "操作"; }
    .product-table td:nth-of-type(7)::before { content: "QRコード"; }
    
    /* 特定の要素のスタイリング強化 */
    .manual-section, .section {
        padding: 12px;
        margin-top: 20px;
    }
    
    .btn-small {
        display: inline-block;
        width: auto;
        margin: 3px;
    }
    
    .alert {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    /* 操作ボタンを横並びにする */
    .product-table td:last-child {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        padding-left: 12px;
    }
    
    /* テーブル内のボタンサイズを調整 */
    .product-table .btn-small {
        padding: 8px 12px;
        font-size: 13px;
        margin-bottom: 0;
    }
    
    /* マニュアルセクションの調整 */
    .manual-section h3 {
        font-size: 1.1rem;
    }
}
.qr-test-container {
    text-align: center;
    margin: 30px 0;
}

.qr-test-container img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.install-steps li {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #0275d8;
}

.install-steps strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
    color: #0275d8;
}

.instruction-box, .note-box {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.instruction-box h2, .note-box h3 {
    margin-bottom: 15px;
    color: #333;
}

.note-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.note-box ul {
    padding-left: 20px;
    margin: 10px 0;
}

.note-box li {
    margin-bottom: 8px;
}

.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* データテーブルのスタイル */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9em;
}

/* データプレビュー */
.data-preview {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    overflow-wrap: break-word;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

.data-table th, .data-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.data-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.data-table tr:nth-child(even) {
    background-color: #f8f8f8;
}

/* システム通知 */
.system-notice {
    margin: 15px 0;
    padding: 10px 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    color: #856404;
}

.system-notice p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.system-notice .btn-warning {
    background-color: #ffc107;
    color: #212529;
    font-weight: bold;
}

/* カレンダーリダイレクトページ関連スタイル */
.calendar-page {
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: left;
}

.countdown {
    font-size: 16px;
    margin: 10px 0;
    color: #666;
}

.big-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    padding: 15px;
    font-size: 18px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.big-button:hover {
    background-color: #2980b9;
}

.instructions {
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
    text-align: left;
}

.instructions ol {
    margin-left: 20px;
    text-align: left;
}

/* ヘルプページのモバイル最適化 */
.mobile-friendly h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.mobile-friendly p {
    line-height: 1.5;
}

.mobile-step {
    position: relative;
}

@media (max-width: 768px) {
    .mobile-friendly h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .help-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .mobile-step {
        padding: 12px 10px;
    }
    
    .mobile-optimized .step-number {
        top: 12px;
        left: 10px;
        position: absolute;
    }
    
    .mobile-optimized strong {
        display: block;
        padding-left: 35px;
        margin-bottom: 5px;
    }
    
    .mobile-optimized p {
        padding-left: 35px;
        font-size: 14px;
    }
}

/* モバイル対応追加スタイル */
@media (max-width: 768px) {
    .calendar-page {
        margin: 10px auto;
        padding: 15px;
    }
    
    .product-info {
        padding: 12px;
        margin: 12px 0;
    }
    
    .big-button {
        padding: 14px;
        font-size: 16px;
        margin: 15px auto;
    }
    
    .instructions {
        padding: 12px;
    }
    
    .instructions ol {
        margin-left: 15px;
        padding-left: 0;
    }
    
    .help-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .step {
        padding: 12px;
        margin: 8px 0;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 14px;
    }
    
    /* タッチ操作の最適化 */
    .step, .big-button, .btn, input[type="checkbox"], input[type="radio"] {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .step strong {
        display: block;
        margin-bottom: 5px;
    }
}

/* 全体的なモバイル最適化と追加対応 */
@media (max-width: 768px) {
    /* フォーム全体の最適化 */
    form {
        padding: 10px 5px;
    }
    
    /* フィールドセットとレジェンド */
    fieldset {
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 10px;
    }
    
    legend {
        padding: 0 8px;
        font-size: 16px;
    }
    
    /* チェックボックスグループのモバイル対応 */
    .checkbox-group {
        padding: 5px 0;
    }
    
    .checkbox-group input[type="checkbox"] {
        min-width: 22px;
        min-height: 22px;
        margin-right: 10px;
    }
    
    /* 操作性向上のためのタッチターゲットサイズ拡大 */
    input[type="radio"],
    input[type="checkbox"],
    .radio-label,
    .btn,
    .btn-small,
    .links a {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .radio-label, 
    .checkbox-group label {
        padding: 10px 0;
        display: flex;
        align-items: center;
    }
    
    input[type="radio"],
    input[type="checkbox"] {
        transform: scale(1.2);
    }
    
    /* ボタンとリンクのタッチ領域拡大 */
    .btn, 
    .btn-small,
    .links a {
        padding: 12px 15px;
    }
    
    /* QRコード画面の最適化 */
    .current-qrcode {
        padding: 10px;
        margin: 15px 0;
        background-color: #f9f9f9;
        border-radius: 5px;
    }
    
    /* アラートのモバイル調整 */
    .alert {
        padding: 12px;
        margin-bottom: 15px;
        font-size: 15px;
    }
    
    /* テキストエリア最適化 */
    textarea {
        padding: 10px;
        line-height: 1.4;
    }
    
    /* ヘルプテキスト最適化 */
    .help-text {
        font-size: 13px;
        line-height: 1.4;
        margin-top: 5px;
    }
    
    /* 代替方法セクションのモバイル最適化 */
    .alternative-method,
    .alternative-section {
        padding: 12px;
        margin: 15px 0;
    }
    
    .alternative-section .step {
        padding: 10px;
    }
    
    /* フォームアクションの余白調整 */
    .form-actions {
        margin-top: 20px;
        margin-bottom: 15px;
    }
    
    /* 印刷ボタン拡大（タップしやすく） */
    button.btn-info {
        padding: 12px 20px;
    }
    
    /* QRコード表示時のスタイル */
    img.qrcode-image {
        margin: 15px auto;
        border: 1px solid #eee;
        padding: 5px;
        background: white;
    }
}

/* スクロール操作の改善 */
@media (max-width: 768px) {
    /* スムーズスクロール */
    html {
        scroll-behavior: smooth;
    }
    
    /* オーバーフロー処理 */
    .product-table {
        overflow-x: hidden;
    }
    
    /* モバイルでのテキスト選択色 */
    ::selection {
        background: rgba(52, 152, 219, 0.3);
    }
    
    /* スクロールバーのカスタマイズ */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #bbb;
        border-radius: 4px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
    
    /* テーブルセルの表示調整（特にQRコード関連列） */
    .product-table td[data-label="QRコード"] img {
        max-width: 80px;
        height: auto;
    }
      /* スマートフォン縦向き（特に小さい画面）向けの調整 */
    @media (max-width: 480px) {
        h1 {
            font-size: 1.4rem;
            margin-bottom: 12px;
        }
        
        h2 {
            font-size: 1.2rem;
        }
        
        h3, h4 {
            font-size: 1.1rem;
        }
        
        .container {
            padding: 10px 8px;
        }
        
        .qrcode-container {
            padding: 12px 8px;
        }
        
        .product-table td {
            font-size: 14px;
            padding: 10px 8px 10px 45%;
        }
        
        .product-table td::before {
            left: 8px;
        }
    }
}

/* モーダル関連のスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 1050; /* popup-overlayよりも高いz-indexを設定 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    z-index: 1051; /* モーダル自体よりも高いz-indexを設定 */
    margin: 5% auto;
    padding: 0;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    width: 80%;
    max-width: 700px;
    animation: modalopen 0.3s;
}

@keyframes modalopen {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.modal-body {
    padding: 15px;
}

/* 表示テキストプレビュー機能のスタイル */
/* プレビューボタン関連 */
.preview-button-container {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.preview-hint {
    margin-left: 10px;
    font-size: 0.85rem;
    color: #666;
}

/* プレビューエリア */
.memo-preview-area {
    margin: 30px auto 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #fff;
    max-width: 90%;
    width: 360px;
    max-height: 70vh;
    overflow-y: auto;
}

.memo-preview-area h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.memo-preview-content {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #28a745;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* エディタ情報スタイル */
.editor-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #17a2b8;
}

.editor-info p {
    margin-top: 0;
    margin-bottom: 5px;
}

.editor-info ul {
    margin: 0;
    padding-left: 20px;
}

.editor-info li {
    margin-bottom: 3px;
}

.link-icon {
    font-size: 1.2em;
    color: #0275d8;
    vertical-align: middle;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .memo-preview-area {
        padding: 10px;
    }
    
    .memo-preview-content {
        padding: 10px;
    }
    
    .editor-info {
        font-size: 0.75rem;
    }
}

/* メモ関連スタイル */
.memo-preview, .remarks-preview {
    display: inline-block;
    margin-right: 10px;
    color: #555;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* 表示テキストのスタイル */
.memo-content {
    margin-bottom: 10px;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #0275d8;
    font-size: 0.9rem;
    max-height: 120px;
    overflow-y: auto;
}

.memo-content p {
    margin: 0 0 0.5em 0;
}

.memo-content p:last-child {
    margin-bottom: 0;
}

/* リッチテキスト内のリンクスタイル */
.memo-content a {
    color: #0275d8;
    text-decoration: underline;
    word-break: break-all;
}

.memo-content a:hover {
    text-decoration: none;
}

/* 表示テキスト内のテーブルスタイル */
.memo-content table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
    font-size: 0.85em;
}

.memo-content table td,
.memo-content table th {
    border: 1px solid #ddd;
    padding: 4px 8px;
}

/* 表示テキスト内のリストスタイル */
.memo-content ul,
.memo-content ol {
    padding-left: 20px;
    margin: 5px 0;
}

/* 表示テキスト内の引用ブロックスタイル */
.memo-content blockquote {
    margin: 8px 0;
    padding: 8px 15px;
    border-left: 3px solid #eee;
    color: #666;
    background-color: #f9f9f9;
}

/* QRコード表示関連スタイル */
.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.qr-thumbnail {
    border: 1px solid #ddd;
    padding: 2px;
    background: white;
}

.qr-display-container {
    text-align: center;
    margin-bottom: 20px;
}

.qr-display {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border: 1px solid #ddd;
    padding: 10px;
    background: white;
}

.qr-download-options {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

.qr-download-options h4 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.download-buttons {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

/* 通知日の説明テキスト */
.notification-text {
    font-size: 0.85rem;
    color: #666;
    display: inline-block;
    margin-top: 3px;
}

/* CKEditorスタイル */
.ck-editor__editable {
    min-height: 200px;
    max-height: 400px;
}

/* リンク付きコンテンツのスタイル */
td a {
    color: #0275d8;
    text-decoration: underline;
}

td a:hover {
    text-decoration: none;
}

/* カレンダーアプリ選択スタイル */
.calendar-apps-container {
    text-align: center;
    margin: 30px 0;
}

.calendar-apps-container h3 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.calendar-event-section {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.calendar-event-section h4 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
}

.calendar-apps-grid {
    max-width: 500px;
    margin: 0 auto;
}

.calendar-app-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    height: 100px;
}

.calendar-app-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.calendar-app-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-app-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.calendar-app-button span {
    font-size: 14px;
    font-weight: 500;
}

/* 各カレンダーアプリのアイコンとカラー */
.google-calendar {
    border-top: 4px solid #4285F4;
}

.apple-calendar {
    border-top: 4px solid #FF3B30;
}

.outlook-calendar {
    border-top: 4px solid #0078D4;
}

.other-calendar {
    border-top: 4px solid #34A853;
}

.apple-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FF3B30' d='M12 1a11 11 0 1 0 0 22 11 11 0 0 0 0-22z'/%3E%3Cpath fill='white' d='M17 12.14V14h-2v2h-2v-2h-2v-2h2v-2h2v2h2v.14z'/%3E%3C/svg%3E");
}

.outlook-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230078D4' d='M12 1a11 11 0 1 0 0 22 11 11 0 0 0 0-22z'/%3E%3Cpath fill='white' d='M17,12.14V14h-7v-2h7V12.14z'/%3E%3Cpath fill='white' d='M14 10h-4v5h4v-5z'/%3E%3C/svg%3E");
}

.other-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2334A853' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM9 10H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm-8 4H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2z'/%3E%3C/svg%3E");
}

/* カレンダーアプリモバイル対応 */
@media (max-width: 480px) {
    .calendar-apps-grid {
        grid-template-columns: 1fr;
        max-width: 90%;
    }
    
    .calendar-app-button {
        padding: 12px;
        height: 80px;
    }
    
    .calendar-app-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 5px;
    }
    
    .calendar-app-button span {
        font-size: 13px;
    }
    
    .calendar-event-section {
        padding: 12px;
    }
    
    .calendar-event-section h4 {
        font-size: 1.1rem;
    }
    
    .calendar-apps-container h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}

.calendar-events-wrapper {
    margin-bottom: 30px;
}

/* メモポップアップスタイル */
.memo-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 90%;
    width: 360px;
    max-height: 70vh;
    overflow-y: auto;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
    transition: color 0.2s;
    line-height: 1;
}

.popup-close:hover {
    color: #333;
}

.popup-content {
    margin-bottom: 15px;
}

.memo-text {
    line-height: 1.5;
    word-break: break-word;
    font-size: 15px;
}

.memo-text .image {
    text-align: center;
}

.memo-text .image img {
    max-width: 100%;
    width: auto;
    height: auto;
}

.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

/* リッチテキスト表示用のスタイル */
.memo-text a, .memo-content-display a {
    color: #0275d8;
    text-decoration: underline;
    word-break: break-all;
}

.memo-text a:hover, .memo-content-display a:hover {
    text-decoration: none;
}

.memo-content-display {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    margin-top: 5px;
    line-height: 1.5;
}

/* テーブル表示のスタイル */
.memo-text table, .memo-content-display table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
}

.memo-text table td, .memo-content-display table td,
.memo-text table th, .memo-content-display table th {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 0.9em;
}

/* リスト表示のスタイル */
.memo-text ul, .memo-content-display ul,
.memo-text ol, .memo-content-display ol {
    padding-left: 20px;
}

/* 引用ブロックのスタイル */
.memo-text blockquote, .memo-content-display blockquote {
    margin: 10px 0;
    padding: 10px 20px;
    border-left: 5px solid #eee;
    color: #666;
}

/* QRコード設定フォーム（スマホ・PC両対応/崩れ修正） */
fieldset.form-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    padding: 8px 8px 12px 8px;
    margin-bottom: 18px;
}
legend {
    width: auto;
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1em;
    padding: 0 6px;
}
.form-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 14px;
}
.memo-input-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}
textarea, input[type="text"], input[type="number"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 8px;
    margin: 0;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}
@media (max-width: 767px) {
    fieldset.form-group, .form-group, .memo-input-container, textarea, input[type="text"], input[type="number"] {
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: auto;
        padding-left: 0;
        padding-right: 0;
    }
    legend {
        max-width: 90vw;
        font-size: 1em;
        padding: 0 4px;
    }
}

/* メモプレビューポップアップの×ボタンを統一・右寄せ */
#memoPreviewArea .close-preview,
#memoPreviewArea .popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
    transition: color 0.2s;
    line-height: 1;
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    padding: 0 6px;
    text-align: right;
    display: block;
}
#memoPreviewArea .close-preview:hover,
#memoPreviewArea .popup-close:hover {
    color: #e74c3c;
}
#memoPreviewArea {
    position: relative;
}
