/* General Body and Container */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh;
    margin: 0;
    padding: 0; 
}

/* --- Page Header Style --- */
.site-header {
    width: 100%;
    background-color: #ffffff;
    color: #333333; 
    padding-top: 15px;
    padding-bottom: 15px; 
    margin-bottom: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    position: sticky;
    top: 0;
    z-index: 100; 
}
.header-content {
    width: 95%;
    max-width: 800px; 
    margin: 0 auto;
}
.site-header h1 {
    margin: 0;
    font-size: 1.8em;
    color: #1abc9c; /* ブライトミント */
}
.site-header .subtitle {
    color: #7f8c8d;
    margin: 0;
    font-size: 1em;
}

/* --- Main Container Style --- */
.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 800px;
    margin: 20px auto; 
}

/* --- Breadcrumbs Style (Container内に移動のため調整) --- */
.breadcrumbs-wrapper {
    width: 100%;
    padding: 0 0 15px 0; /* 下に余白 */
    margin-bottom: 5px;
}
.breadcrumbs-wrapper ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9em;
}
.breadcrumbs-wrapper li {
    display: flex;
    align-items: center;
}
/* 区切り文字 */
.breadcrumbs-wrapper li:not(:last-child)::after {
    content: ">";
    margin: 0 8px;
    color: #7f8c8d; 
}
/* Link Styles */
.breadcrumbs-wrapper a {
    color: #7f8c8d; 
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs-wrapper a:hover {
    text-decoration: underline;
    color: #333333; 
}
.breadcrumbs-wrapper li[aria-current="page"] {
    color: #7f8c8d; 
    font-weight: normal; 
}

/* --- Page Footer Style (横並びレイアウトに変更) --- */
.page-footer {
    width: 100%;
    background-color: #34495e; /* スレートブルー */
    color: #ddd;
    padding: 40px 0 20px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    margin-top: auto; 
}
.footer-content {
    max-width: 800px;
    width: 95%;
    margin: 0 auto; 
    padding: 0 10px;
    box-sizing: border-box;
}

/* Footer Flex Layout */
.footer-links-layout {
    display: flex;
    justify-content: flex-start;
    gap: 60px; /* カラム間の余白 */
    margin-bottom: 20px;
}
.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-column .section-title {
    font-size: 1em;
    font-weight: bold;
    color: #1abc9c; /* セクションタイトル色 */
    margin-top: 0;
    margin-bottom: 15px;
}
.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-column li {
    margin-bottom: 8px;
}
.footer-column li a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}
.footer-column li a:hover {
    color: #fff;
    text-decoration: underline;
}

.copyright {
    text-align: center;
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #556c80; /* 区切り線 */
}

/* --- Usage Notice Style (新規追加: カード最下部) --- */
.usage-notice {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}
.usage-notice h3 {
    font-size: 1em;
    color: #34495e;
    margin: 0 0 10px 0;
    border: none;
    padding: 0;
}
.usage-notice ul {
    list-style: disc inside;
    padding: 0;
    margin: 0;
    color: #555;
    font-size: 0.85em;
}
.usage-notice li {
    margin-bottom: 5px;
    padding-left: 0;
    line-height: 1.5;
}

/* --- 既存スタイルの維持 --- */

h2 { font-size: 1.5em; color: #34495e; border-left: 5px solid #16a085; padding-left: 10px; margin: 20px 0 15px; }
h3.timer-guide-title, h3.participant-title {
    font-size: 1.2em;
    color: #34495e;
    margin-top: 5px;
    margin-bottom: 10px;
    padding-left: 5px;
    border-left: 3px solid #1abc9c;
}

.notice { font-size: 0.8em; color: #7f8c8d; margin-top: -5px; margin-bottom: 10px; }

.controls-wrapper { display: flex; flex-direction: column; gap: 10px; background-color: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.controls-wrapper label { font-weight: bold; color: #555; margin-top: 5px; }
.controls-wrapper input[type="text"], .controls-wrapper input[type="number"], .controls-wrapper select { padding: 8px; font-size: 16px; border: 1px solid #ddd; border-radius: 5px; width: 100%; box-sizing: border-box; }

.main-btn, .sub-btn { padding: 12px 20px; font-size: 16px; font-weight: bold; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; width: 100%; margin-top: 15px; box-sizing: border-box; }
.main-btn { background-color: #1abc9c; color: #fff; }
.main-btn:hover { background-color: #16a085; }
.sub-btn { background-color: #34495e; color: #fff; width: auto; display: inline-block; }
.sub-btn:hover { background-color: #2c3e50; }

/* 停止・リセットボタン用 */
.pause-btn { background-color: #e74c3c !important; }
.pause-btn:hover { background-color: #c0392b !important; }
.reset-btn-color { background-color: #7f8c8d !important; }
.reset-btn-color:hover { background-color: #555555 !important; }
.disabled-btn { background-color: #95a5a6 !important; cursor: not-allowed !important; pointer-events: none !important; opacity: 0.8; }

.result-container { margin-top: 30px; padding-top: 15px; border-top: 2px solid #16a085; }
.hidden { display: none !important; }
.button-separator { height: 1px; background-color: #dddddd; margin: 15px 0 5px 0; }

/* 参加者入力フォーム */
.setting-group { margin-bottom: 10px; }
.participant-group { 
    margin-bottom: 15px; padding: 10px; border: 1px solid #ddd; border-left: 3px solid #3498db; border-radius: 5px; 
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; 
}
.participant-group > div { display: flex; flex-direction: column; min-width: 100px; }
.participant-group > div:nth-child(1) { flex: 1 1 150px; }
.participant-group > div:nth-child(2) { flex: 1 1 120px; max-width: 200px; }
.participant-group > div:nth-child(3) { flex: 1 1 100px; max-width: 150px; }
.participant-group .remove-btn {
    flex: 0 0 auto; width: 60px; background-color: #e74c3c; color: #fff; padding: 8px 5px; font-size: 14px; border: none; border-radius: 5px; cursor: pointer; align-self: flex-end; margin-top: 0; margin-left: auto; 
}

/* 計算根拠の注意書き */
.calculation-note { font-size: 0.8em; color: #555; background-color: #e8f8f5; padding: 8px 12px; border-radius: 5px; margin-top: -5px; margin-bottom: 10px; }
.calculation-note p { margin: 0; }

/* 予定コスト表示 */
.pre-calc-wrapper { background-color: #e8f8f5; color: #34495e; padding: 15px 20px; border-radius: 8px; margin-bottom: 15px; text-align: center; font-size: 1.1em; font-weight: bold; }
.pre-calc-wrapper .cost-value { color: #16a085; font-size: 1.5em; margin: 0 5px; }
.pre-calc-wrapper.error { background-color: #fbeeeC; color: #e74c3c; }

/* コストボード */
.board-wrapper {
    background-color: #34495e; color: #e8f8f5; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); position: relative; display: flex; flex-direction: column;
}
.online-header {
    display: flex; justify-content: space-between; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #2c3e50; flex-wrap: wrap; gap: 10px;
}
.header-item { flex: 1 1 200px; }
.header-item .label { font-size: 0.9em; color: #95a5a6; display: block; }
.header-item .value { font-size: 1.3em; font-weight: bold; color: #1abc9c; }
.overall-remaining-time { font-family: 'monospace'; }

.online-main-display { text-align: center; margin-bottom: 10px; }
.time-block { margin-top: 15px; }
.time-block .label { font-size: 1.1em; color: #95a5a6; }
.time-display { font-family: 'monospace'; font-size: 4em; font-weight: bold; margin-top: -5px; color: #fff; line-height: 1.2; }

/* 参加者別コストリスト */
.participant-cost-list-wrapper { margin-top: 20px; border-top: 1px solid #2c3e50; padding-top: 15px; }
.participant-list-title { font-size: 1.1em; color: #1abc9c; margin-top: 0; margin-bottom: 10px; }
.participant-cost-item { display: grid; grid-template-columns: 2fr 1.5fr 1fr; gap: 10px; padding: 8px 5px; border-bottom: 1px solid #2c3e50; font-size: 0.9em; align-items: center; }
.participant-cost-item:last-child { border-bottom: none; }
.p-item-name { font-weight: bold; color: #fff; word-break: break-all; }
.p-item-hourly { font-size: 0.85em; color: #95a5a6; text-align: right; }
.p-item-cost { font-size: 1.1em; font-weight: bold; color: #e8f8f5; font-family: 'monospace'; text-align: right; }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 15px; max-width: 100%; }
    .footer-content { width: 100%; padding: 0 15px; }

    /* Footer Mobile: 縦並びに戻す */
    .footer-links-layout { flex-direction: column; gap: 20px; }

    .participant-group { flex-direction: column; align-items: stretch; }
    .participant-group > div { min-width: 100%; max-width: 100% !important; }
    .participant-group .remove-btn { width: 100%; margin-top: 5px; margin-left: 0; }
    
    .online-header { flex-direction: column; gap: 10px; }
    .online-main-display .time-display { font-size: 3em; }

    .participant-cost-item { grid-template-columns: 1fr 1fr; row-gap: 2px; }
    .p-item-name { grid-row: 1 / 2; grid-column: 1 / 2; }
    .p-item-hourly { grid-row: 2 / 3; grid-column: 1 / 2; text-align: left; }
    .p-item-cost { grid-row: 1 / 3; grid-column: 2 / 3; align-self: center; font-size: 1.2em; }
}