/* ═══════════════════════════════════════════════════════════
   割り勘・立替精算アルゴリズムツール — styles
   prefix: wc-
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.wc-container {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    max-width: 740px;
    margin: 0 auto;
    padding: 0 16px 40px;
    color: #1f2937;
}

/* ── Feature Banner ── */
.wc-feature-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1.5px solid #6ee7b7;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 24px;
}

.wc-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.wc-feature-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.wc-feature-item strong {
    font-size: 13px;
    font-weight: 700;
    color: #065f46;
    display: block;
    margin-bottom: 2px;
}

.wc-feature-item p {
    font-size: 12px;
    color: #047857;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .wc-feature-banner {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Step Cards ── */
.wc-step-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.wc-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
    letter-spacing: 0.4px;
}

.wc-step-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
}

/* ── Member Input ── */
.wc-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.wc-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    transition: border-color 0.15s;
    background: #fafafa;
}

.wc-input:focus {
    outline: none;
    border-color: #10b981;
    background: #fff;
}

.wc-btn-add {
    padding: 10px 18px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: opacity 0.15s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.wc-btn-add:hover {
    opacity: 0.88;
}

/* ── Member Chips ── */
.wc-members-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    padding: 8px 0 2px;
}

.wc-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #a7f3d0;
    border-radius: 20px;
    padding: 5px 10px 5px 12px;
    font-size: 13px;
    font-weight: 600;
    animation: wc-chip-in 0.18s ease;
}

@keyframes wc-chip-in {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.wc-member-chip-del {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #a7f3d0;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: #065f46;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
    flex-shrink: 0;
}

.wc-member-chip-del:hover {
    background: #6ee7b7;
}

.wc-empty-hint {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

/* ── Expense Form ── */
.wc-expense-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

@media (max-width: 520px) {
    .wc-expense-form {
        grid-template-columns: 1fr;
    }
}

.wc-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wc-form-group.full {
    grid-column: 1 / -1;
}

.wc-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.wc-select {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fafafa;
    transition: border-color 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.wc-select:focus {
    outline: none;
    border-color: #10b981;
    background-color: #fff;
}

.wc-input-money {
    position: relative;
}

.wc-input-money::before {
    content: '¥';
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #9ca3af;
    font-weight: 600;
    pointer-events: none;
}

.wc-input-money input {
    padding-left: 28px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Target Members Checkboxes ── */
.wc-target-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0 4px;
}

.wc-target-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    color: #4b5563;
}

.wc-target-chip input {
    display: none;
}

.wc-target-chip.checked {
    background: #ecfdf5;
    border-color: #34d399;
    color: #065f46;
}

.wc-target-all {
    font-size: 12px;
    padding: 4px 10px;
    background: #f0fdf4;
    border-color: #a7f3d0;
    color: #059669;
}

/* ── Expense List ── */
.wc-expense-list {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 16px;
}

.wc-expense-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1.5px solid #e5e7eb;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.wc-expense-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    gap: 10px;
    animation: wc-chip-in 0.18s ease;
}

.wc-expense-item:last-child {
    border-bottom: none;
}

.wc-expense-item-left {
    flex: 1;
    min-width: 0;
}

.wc-expense-payer {
    font-size: 13px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 2px;
}

.wc-expense-memo {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-expense-targets {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.wc-expense-amount {
    font-size: 16px;
    font-weight: 800;
    color: #1f2937;
    white-space: nowrap;
}

.wc-expense-del {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}

.wc-expense-del:hover {
    background: #fee2e2;
    color: #ef4444;
}

.wc-expense-empty {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

.wc-expense-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.wc-expense-total-amount {
    color: #059669;
    font-size: 16px;
}

/* ── Calc Button ── */
.wc-btn-calc {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    transition: opacity 0.2s, transform 0.1s;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.wc-btn-calc:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.wc-btn-calc:active {
    transform: scale(0.98);
}

.wc-btn-calc:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Result Card ── */
.wc-result-card {
    background: #fff;
    border: 2px solid #10b981;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    display: none;
}

.wc-result-card.visible {
    display: block;
    animation: wc-chip-in 0.25s ease;
}

.wc-result-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wc-summary-item {
    flex: 1;
    min-width: 120px;
    background: #f0fdf4;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
}

.wc-summary-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.wc-summary-value {
    font-size: 20px;
    font-weight: 800;
    color: #059669;
}

/* ── Balance List ── */
.wc-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wc-balance-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.wc-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 14px;
}

.wc-balance-name {
    font-weight: 600;
    color: #374151;
}

.wc-balance-amount-plus {
    font-weight: 800;
    font-size: 15px;
    color: #059669;
}

.wc-balance-amount-minus {
    font-weight: 800;
    font-size: 15px;
    color: #ef4444;
}

.wc-balance-amount-zero {
    font-weight: 600;
    font-size: 14px;
    color: #9ca3af;
}

/* ── Settlement Cards ── */
.wc-settlement-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wc-settlement-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.wc-transfer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.wc-transfer-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f0fdf4;
    border: 1.5px solid #a7f3d0;
    border-left: 5px solid #10b981;
    border-radius: 10px;
    padding: 14px 18px;
    animation: wc-chip-in 0.2s ease;
}

.wc-transfer-names {
    flex: 1;
}

.wc-transfer-from {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 2px;
}

.wc-transfer-from strong {
    color: #ef4444;
    font-weight: 700;
}

.wc-transfer-to {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.wc-transfer-to strong {
    color: #059669;
    font-weight: 700;
}

.wc-transfer-arrow {
    font-size: 20px;
    color: #6ee7b7;
    flex-shrink: 0;
}

.wc-transfer-amount {
    font-size: 20px;
    font-weight: 800;
    color: #059669;
    white-space: nowrap;
    flex-shrink: 0;
}

.wc-settled-badge {
    text-align: center;
    padding: 12px;
    background: #ecfdf5;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #065f46;
}

/* ── Action Buttons ── */
.wc-action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wc-btn-action {
    flex: 1;
    min-width: 130px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: #374151;
    transition: all 0.15s;
    text-align: center;
    white-space: nowrap;
}

.wc-btn-action:hover {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.wc-btn-action.copied {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.wc-url-warn {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fef3c7;
    border: 1.5px solid #fcd34d;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    display: none;
}

/* ── Reset ── */
.wc-btn-reset {
    display: block;
    width: 100%;
    padding: 11px;
    border: 1.5px solid #e5e7eb;
    background: transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    text-align: center;
    margin-top: 10px;
}

.wc-btn-reset:hover {
    border-color: #d1d5db;
    color: #6b7280;
    background: #f9fafb;
}

/* ── Share Image Button ── */
.wc-btn-share {
    display: block !important;
    width: 100% !important;
    padding: 18px 24px !important;
    background: linear-gradient(135deg, #059669 0%, #10b981 60%, #34d399 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-bottom: 14px !important;
    letter-spacing: 0.3px;
    text-align: center !important;
    line-height: 1.4 !important;
    outline: none !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.wc-btn-share:hover {
    opacity: 0.9 !important;
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.55) !important;
    transform: translateY(-1px);
}

.wc-btn-share:active {
    transform: scale(0.98) !important;
}

.wc-btn-share:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Share Preview ── */
.wc-share-preview {
    background: #f0fdf4;
    border: 1.5px solid #a7f3d0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.wc-share-hint {
    font-size: 13px;
    font-weight: 600;
    color: #065f46;
    margin: 0 0 12px;
    line-height: 1.5;
}

.wc-share-img {
    display: block;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.15s;
    -webkit-touch-callout: default;
}

.wc-share-img:active {
    transform: scale(0.99);
}

/* ── Clipboard copy image button ── */
.wc-btn-copy-img {
    display: block !important;
    width: 100% !important;
    margin-top: 12px !important;
    padding: 12px 16px !important;
    background: #fff !important;
    color: #059669 !important;
    border: 2px solid #10b981 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    text-align: center !important;
    transition: all 0.15s;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.wc-btn-copy-img:hover {
    background: #ecfdf5 !important;
    border-color: #059669 !important;
}

.wc-btn-copy-img.copied {
    background: #059669 !important;
    color: #fff !important;
    border-color: #059669 !important;
}