/* ============================================================
   Kumiai Scheduler - フロントエンドスタイル
   方針：大きめフォント・大きいボタン・シンプル・スマホ対応
   ============================================================ */

.ks-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 16px;
    font-size: 17px;
    line-height: 1.7;
    color: #333;
}

/* ---- ヒーロー ---- */
.ks-hero {
    text-align: center;
    padding: 28px 0 20px;
}
.ks-title {
    font-size: 1.9em;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a5276;
}
.ks-subtitle {
    font-size: 1.1em;
    color: #555;
    margin: 0;
}

/* ---- カード ---- */
.ks-card {
    background: #fff;
    border: 1px solid #d5e8f7;
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.ks-center { text-align: center; }

/* ---- セクション見出し ---- */
.ks-section-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 12px;
    color: #1a5276;
}

/* ---- フォーム共通 ---- */
.ks-form { width: 100%; }
.ks-field { margin-bottom: 22px; }

.ks-label {
    display: block;
    font-size: 1.05em;
    font-weight: 700;
    margin-bottom: 6px;
    color: #222;
}
.ks-required {
    background: #e74c3c;
    color: #fff;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.ks-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1.05em;
    border: 2px solid #aac;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color .2s;
    background: #fafcff;
}
.ks-input:focus {
    border-color: #1a5276;
    outline: none;
    background: #fff;
}
.ks-input-name {
    max-width: 340px;
    font-size: 1.15em;
}
.ks-textarea { min-height: 90px; resize: vertical; }

.ks-url-input { font-size: 0.95em; background: #f0f4f8; }

/* ---- ボタン ---- */
.ks-btn {
    display: inline-block;
    padding: 13px 26px;
    font-size: 1.05em;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
    margin: 4px;
    line-height: 1.3;
}
.ks-btn:hover { opacity: .85; transform: translateY(-1px); }
.ks-btn:active { transform: translateY(0); }

.ks-btn-primary  { background: #1a5276; color: #fff; }
.ks-btn-secondary{ background: #2980b9; color: #fff; }
.ks-btn-ghost    { background: #ecf0f1; color: #333; border: 1px solid #bbb; }

.ks-btn-large { padding: 16px 36px; font-size: 1.15em; }

.ks-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- テキスト系 ---- */
.ks-note  { color: #555; font-size: .95em; margin: 6px 0; }
.ks-desc  { color: #444; margin: 0 0 16px; white-space: pre-wrap; }
.ks-count { font-size: 1.1em; margin: 12px 0; }

/* ---- エラー ---- */
.ks-error     { color: #e74c3c; font-weight: bold; }
.ks-error-box {
    background: #fdf0f0;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 18px;
    color: #c0392b;
}

/* ---- 凡例 ---- */
.ks-legend { font-size: .95em; color: #555; margin: 6px 0 12px; }
.ks-mark { font-size: 1.1em; font-weight: 700; margin-right: 3px; }
.ks-o { color: #27ae60; }
.ks-t { color: #e67e22; }
.ks-x { color: #e74c3c; }

/* ---- 回答テーブル ---- */
.ks-answer-table-wrap { overflow-x: auto; }
.ks-answer-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}
.ks-answer-table th,
.ks-answer-table td {
    border: 1px solid #ccd;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}
.ks-th-date  { text-align: left; min-width: 130px; background: #eaf0fb; font-weight: 700; }
.ks-th-mark  { width: 70px; background: #eaf0fb; font-size: 1.2em; }
.ks-td-date  { text-align: left; font-size: 1.05em; padding-left: 12px; }

/* ラジオボタンを大きく見せるカスタム */
.ks-radio-label { cursor: pointer; display: block; width: 100%; }
.ks-radio-label input[type="radio"] { display: none; }
.ks-radio-btn {
    display: block;
    width: 46px;
    height: 46px;
    line-height: 46px;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 1.3em;
    font-weight: 700;
    border: 2px solid #ccc;
    color: #999;
    transition: all .15s;
    background: #f8f8f8;
}
.ks-radio-label input:checked + .ks-radio-btn {
    border-width: 3px;
    color: #fff;
}
.ks-radio-o input:checked + .ks-radio-btn { background: #27ae60; border-color: #1e8449; }
.ks-radio-t input:checked + .ks-radio-btn { background: #e67e22; border-color: #ca6f1e; }
.ks-radio-x input:checked + .ks-radio-btn { background: #e74c3c; border-color: #cb4335; }
.ks-radio-label:hover .ks-radio-btn { border-color: #888; }

/* ---- 結果テーブル ---- */
.ks-result-table-wrap { overflow-x: auto; margin: 16px 0; }
.ks-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .97em;
    min-width: 400px;
}
.ks-result-table th,
.ks-result-table td {
    border: 1px solid #ccd;
    padding: 9px 8px;
    text-align: center;
    vertical-align: middle;
}
.ks-th-name    { text-align: left; min-width: 100px; background: #eaf0fb; }
.ks-th-date-col{ min-width: 80px; background: #eaf0fb; font-size: .92em; }
.ks-th-comment { min-width: 100px; background: #eaf0fb; }
.ks-td-name    { text-align: left; font-weight: 700; padding-left: 10px; }
.ks-td-comment { text-align: left; font-size: .9em; color: #555; padding: 6px 10px; }

.ks-td-ans { font-size: 1.2em; font-weight: 700; }
.ks-ans-o        { color: #27ae60; background: #eafaf1; }
.ks-ans-triangle { color: #e67e22; background: #fef5e7; }
.ks-ans-x        { color: #e74c3c; background: #fdedec; }

.ks-summary-row td { background: #f4f6f9; font-size: .9em; }
.ks-sum-o { color: #27ae60; margin-right: 4px; font-weight: 700; }
.ks-sum-t { color: #e67e22; margin-right: 4px; font-weight: 700; }
.ks-sum-x { color: #e74c3c; font-weight: 700; }

/* ---- シェアボックス ---- */
.ks-share-box {
    background: #eaf4fb;
    border: 2px dashed #2980b9;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 16px 0 20px;
}
.ks-url-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ks-url-row .ks-input { flex: 1; min-width: 200px; }

/* ---- タグ（選択済み日程） ---- */
.ks-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.ks-tag {
    background: #d6eaf8;
    border: 1px solid #2980b9;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: .92em;
    color: #1a5276;
    cursor: pointer;
    transition: background .15s;
}
.ks-tag:hover { background: #aed6f1; }
.ks-tag::after { content: ' ✕'; color: #888; }

/* ---- 入力行（トークン入力） ---- */
.ks-input-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ks-input-row .ks-input { flex: 1; min-width: 180px; }

/* ---- レスポンシブ ---- */
@media (max-width: 600px) {
    .ks-wrap { padding: 10px; }
    .ks-title { font-size: 1.5em; }
    .ks-btn-large { padding: 14px 22px; font-size: 1.05em; }
    .ks-radio-btn { width: 40px; height: 40px; line-height: 40px; font-size: 1.1em; }
    .ks-actions { flex-direction: column; }
    .ks-actions .ks-btn { width: 100%; text-align: center; }
}

/* ============================================================
   イベント一覧
   ============================================================ */

/* タブ */
.ks-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid #dce6f0;
    padding-bottom: 0;
}
.ks-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: 700;
    color: #888;
    cursor: pointer;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: all .15s;
}
.ks-tab:hover { color: #1a5276; background: #eaf0fb; }
.ks-tab-active {
    color: #1a5276;
    border-bottom-color: #1a5276;
    background: #eaf0fb;
}
.ks-badge {
    display: inline-block;
    background: #1a5276;
    color: #fff;
    font-size: .75em;
    border-radius: 20px;
    padding: 1px 8px;
    margin-left: 4px;
    vertical-align: middle;
}
.ks-badge-gray { background: #999; }

/* イベントカード */
.ks-list-card { padding: 20px; }
.ks-event-card {
    border: 1px solid #d0dce8;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    background: #fff;
}
.ks-event-card:hover {
    box-shadow: 0 4px 12px rgba(26,82,118,.12);
    border-color: #2980b9;
}
.ks-event-card-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.ks-event-info { flex: 1; min-width: 0; }
.ks-event-title {
    font-size: 1.15em;
    font-weight: 700;
    color: #1a5276;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ks-event-dates {
    font-size: .92em;
    color: #444;
    margin-bottom: 4px;
}
.ks-event-meta {
    font-size: .88em;
    color: #888;
}
.ks-event-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.ks-btn-sm {
    padding: 8px 14px;
    font-size: .88em;
}
.ks-btn-danger {
    background: #fadbd8;
    color: #c0392b;
    border: 1px solid #e74c3c;
}
.ks-btn-danger:hover { background: #f1948a; color: #fff; }

/* 通知 */
.ks-notice {
    background: #eafaf1;
    border: 1px solid #27ae60;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
    color: #1e8449;
    font-weight: 700;
}
.ks-empty { padding: 20px 0; text-align: center; color: #aaa; }

@media (max-width: 600px) {
    .ks-event-card-inner { flex-direction: column; align-items: flex-start; }
    .ks-event-actions { width: 100%; }
    .ks-event-actions .ks-btn { flex: 1; text-align: center; }
}

/* ============================================================
   時刻追加オプション
   ============================================================ */
.ks-time-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.ks-time-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .95em;
    color: #1a5276;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    background: #eaf4fb;
    border: 1px solid #aad;
    border-radius: 20px;
    padding: 5px 14px;
}
.ks-time-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a5276;
}
.ks-time-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef9e7;
    border: 1px dashed #e67e22;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ks-time-icon { font-size: 1.2em; flex-shrink: 0; }
.ks-time-input {
    max-width: 240px;
    font-size: 1.05em;
    background: #fff;
}
.ks-time-hint {
    font-size: .85em;
    color: #888;
}

/* タグに時刻編集欄 */
.ks-tag-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.ks-tag-time-edit {
    border: 1px solid #aac;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: .9em;
    width: 130px;
    background: #fafcff;
    color: #333;
}
.ks-tag-time-edit:focus {
    border-color: #1a5276;
    outline: none;
}
.ks-tag-x { color: #aaa; font-size: .8em; margin-left: 4px; }

/* タグのflexをcolumnに変更（tag-rowのため） */
.ks-tags {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .ks-time-toggle-row { flex-direction: column; align-items: flex-start; }
    .ks-time-input { max-width: 100%; }
}

/* ============================================================
   日程入力 テキストエリア方式
   ============================================================ */
.ks-datepicker-inline {
    margin-bottom: 10px;
    background: #eaf4fb;
    border-color: #2980b9;
    font-size: 1em;
    cursor: pointer;
}
.ks-datepicker-inline:hover {
    background: #d6eaf8;
}
.ks-dates-textarea {
    min-height: 130px;
    resize: vertical;
    font-size: 1.05em;
    line-height: 1.9;
    font-family: inherit;
    background: #fffef5;
    border-color: #e67e22;
}
.ks-dates-textarea:focus {
    border-color: #ca6f1e;
    background: #fff;
}

/* ============================================================
   候補日程入力 v3（テキストエリア＋チェックボックス方式）
   ============================================================ */
.ks-time-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--color-background-secondary, #f4f6f9);
    border: 1px solid #d0dce8;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 10px;
}
.ks-time-check-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .97em;
    font-weight: 700;
    color: #1a5276;
    cursor: pointer;
    white-space: nowrap;
}
.ks-time-check-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #1a5276;
}
.ks-time-input {
    max-width: 220px !important;
    font-size: 1em !important;
    background: #fff !important;
}
.ks-time-hint {
    font-size: .85em;
    color: #888;
    white-space: nowrap;
}
.ks-datepicker-btn {
    background: #eaf4fb !important;
    border-color: #2980b9 !important;
    cursor: pointer !important;
    margin-bottom: 8px;
    font-size: 1em;
}
.ks-datepicker-btn:hover { background: #d6eaf8 !important; }
.ks-dates-textarea {
    min-height: 150px;
    resize: vertical;
    font-size: 1.05em !important;
    line-height: 1.9 !important;
    background: #fffef5 !important;
    border-color: #e67e22 !important;
    margin-bottom: 6px;
}
.ks-dates-textarea:focus { background: #fff !important; border-color: #ca6f1e !important; }

/* ============================================================
   候補日程入力 最終版
   ============================================================ */
.ks-time-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f4f6f9;
    border: 0.5px solid #d0dce8;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 10px;
}
.ks-time-label {
    font-size: .95em;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}
.ks-time-input {
    max-width: 180px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    background: #fff !important;
    border-color: #2980b9 !important;
}
.ks-time-hint {
    font-size: .85em;
    color: #888;
}
.ks-cal-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.ks-datepicker-btn {
    width: auto !important;
    min-width: 220px;
    background: #eaf4fb !important;
    border-color: #2980b9 !important;
    cursor: pointer !important;
    font-size: .97em;
    flex-shrink: 0;
}
.ks-datepicker-btn:hover { background: #d6eaf8 !important; }
.ks-dates-textarea {
    flex: 1;
    min-width: 200px;
    min-height: 160px;
    resize: vertical;
    font-size: 1.05em !important;
    line-height: 2 !important;
    background: #fffef5 !important;
    border-color: #e67e22 !important;
}
.ks-dates-textarea:focus {
    background: #fff !important;
    border-color: #ca6f1e !important;
}
@media (max-width: 600px) {
    .ks-cal-row { flex-direction: column; }
    .ks-datepicker-btn { width: 100% !important; }
    .ks-dates-textarea { width: 100%; }
}

/* カレンダー開くボタン */
.ks-cal-open-wrap { position: relative; }
.ks-cal-open-btn  { font-size: 1em !important; padding: 12px 20px !important; }

/* 時刻入力行 */
.ks-time-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f4f6f9;
    border: 1px solid #d0dce8;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 10px;
}
.ks-time-label { font-size: .95em; color: #555; white-space: nowrap; flex-shrink: 0; }
.ks-time-input { max-width: 160px !important; font-weight: 700 !important; background: #fff !important; }
.ks-time-hint  { font-size: .85em; color: #888; }

/* ============================================================
   幹事メニュー・ステータスバナー
   ============================================================ */
.ks-kanji-box {
    border: 1px solid #d0dce8;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 16px 0;
    background: #f8fafc;
}
.ks-kanji-label {
    font-size: .85em;
    color: #888;
    margin-bottom: 10px;
    font-weight: 700;
}
.ks-kanji-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ks-btn-kanji-edit  { background:#E6F1FB; color:#0C447C; border:1px solid #2980b9 !important; }
.ks-btn-kanji-fix   { background:#EAF3DE; color:#27500A; border:1px solid #27ae60 !important; }
.ks-btn-kanji-close { background:#FAEEDA; color:#633806; border:1px solid #e67e22 !important; }
.ks-btn-kanji-del   { background:#FCEBEB; color:#791F1F; border:1px solid #e74c3c !important; }

.ks-fix-panel {
    margin-top: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px dashed #27ae60;
    border-radius: 8px;
}
.ks-closed-banner {
    background: #fef5e7;
    border: 1px solid #e67e22;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    color: #633806;
    font-weight: 700;
}
.ks-fixed-banner {
    background: #eafaf1;
    border: 1px solid #27ae60;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    color: #1e8449;
    font-weight: 700;
    font-size: 1.05em;
}
@media (max-width:600px) {
    .ks-kanji-btns { flex-direction: column; }
    .ks-kanji-btns .ks-btn { width: 100%; text-align: center; }
}
