:root {
--bg-color: #e9ecef;       /* 全体の背景：少し濃くしてエディタを際立たせる */
    --card-bg: #ffffff;
    --info-bg: #fdf8f3;       /* 説明文の背景：温かみのある薄いベージュ */
    --accent-blue: #007bff;
    --accent-green: #28a745;
    --accent-gray: #6c757d;
    --accent-yellow: #ffeb3b;
    --accent-red: #dc3545;
    --border-color: #cbd5e0;  /* 枠線：少しだけ濃くしてくっきりさせる */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
}

/* --- 全体レイアウト --- */
* { box-sizing: border-box; }
body { 
    font-family: sans-serif; 
    background-color: var(--bg-color); 
    padding: 15px; 
    margin: 0; 
}
.app-container { 
    max-width: 500px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

/* --- タイトル入力 --- */
#memo-title { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-sm); 
    font-size: 16px; 
}

/* --- 演算ツールバー --- */
.calc-toolbar { display: flex; gap: 8px; }
.calc-toolbar button {
    flex: 1; height: 50px; font-size: 20px; font-weight: bold;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    background-color: var(--card-bg); cursor: pointer;
}
/* 割引・％ボタン専用 */
#discount-btn, #percent-btn { 
    background-color: var(--accent-yellow); 
    font-size: 16px; 
    border: none; 
}

/* 外枠：高さを固定 */
.editor-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    height: 350px;
    overflow: hidden; /* ここではスクロールさせない */
}

/* 中身のラッパー：ここをスクロールさせる */
.scroll-sync-wrapper {
    display: flex;
    height: 100%;
    overflow-y: auto; /* 縦スクロールをここに集約 */
    overflow-x: hidden;
}

/* --- エディタエリア（視認性向上版） --- */
textarea, #side-results {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 16px;
    line-height: 1.8;
    padding: 15px;
    margin: 0;
    font-weight: 600;
    height: auto; /* 高さを内容に合わせる */
    min-height: 100%;
}

textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    white-space: pre;
    overflow: hidden; /* textarea自体のスクロールバーを消す */
    background: transparent;
}

#side-results {
width: 100px;
    color: var(--accent-blue);
    /* ★修正ポイント：右寄り(right)から左寄り(left)に変更 */
    text-align: left; 
    padding: 15px 10px; /* 左側に少し余白を確保 */
    white-space: pre;
    pointer-events: none;
    border-left: 1px solid #eee;
    font-weight: 700;
}

/* --- 下部アクションボタン --- */
.button-group { display: flex; gap: 10px; }
.button-group button {
    flex: 1; height: 60px; font-size: 14px; font-weight: bold; 
    color: #fff; border: none; border-radius: var(--radius-md); 
    cursor: pointer;
}
#save-list-btn { background-color: var(--accent-blue); }
#download-txt-btn { background-color: var(--accent-green); }
#load-txt-btn { background-color: var(--accent-gray); }
.danger-btn { background-color: var(--accent-red) !important; }

/* --- リスト表示エリア --- */
.memo-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px; background: white; margin-top: 8px;
    border-radius: var(--radius-sm); border-left: 5px solid var(--accent-blue);
    cursor: pointer;
}

/* --- このアプリについてのセクションを調整 --- */
.app-info-section { 
    padding: 20px; 
    background-color: var(--info-bg); 
    border-radius: var(--radius-md); 
    font-size: 13px; 
    color: #4a5568; 
    border: 1px solid #e2e8f0; /* 境界線を薄く追加 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* わずかな影で浮かせる */
}

.app-info-section h3 {
    color: #2d3748;
    margin-top: 0;
    border-bottom: 2px solid #ed8936; /* タイトルの下にアクセントライン */
    display: inline-block;
    margin-bottom: 12px;
}

.important-note { 
background-color: #fff5f5; 
    padding: 12px; 
    border-radius: 6px; 
    border-left: 5px solid #f56565; /* 警告の赤を強調 */
    color: #c53030; 
    margin: 10px 0; 
    line-height: 1.5;
}
.footer-copyright { 
    text-align: center; 
    color: #999; 
    font-size: 11px; 
    margin-top: 15px; 
}

/* --- トースト通知 --- */
.toast-message {
    position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.8); color: white; padding: 10px 20px;
    border-radius: 20px; transition: 0.3s; z-index: 9999; opacity: 0;
}
.toast-message.show { bottom: 30px; opacity: 1; }