* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        sans-serif;

    background: #f6f7f9;
    color: #222;
}


/* =========================
   Header
========================= */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    display: block;

    max-width: 1100px;
    margin: 0 auto;
    padding: 22px 24px;

    color: #222;
    text-decoration: none;

    font-size: 24px;
    font-weight: 700;
}


/* =========================
   Main
========================= */

main {
    max-width: 1100px;
    margin: 0 auto;

    padding: 60px 24px 100px;
}


/* =========================
   Top page
========================= */

.tools-section h1 {
    margin: 0 0 32px;

    font-size: 30px;
    font-weight: 700;
}

.tool-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 18px;
}

.tool-card {
    display: flex;
    align-items: center;

    min-height: 140px;
    padding: 24px;

    background: #2f6f4e;
    border: 1px solid #2f6f4e;
    border-radius: 0;

    color: #ffffff;
    text-decoration: none;

    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}

.tool-card h2 {
    margin: 0;

    font-size: 19px;
    font-weight: 600;
}

.tool-card:hover {
    background: #255a3f;

    transform:
        translateY(-2px);
}


/* =========================
   Calculator
========================= */

.calculator-section {
    max-width: 720px;
    margin: 0 auto;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading h1 {
    margin: 0 0 8px;

    font-size: 32px;
    font-weight: 700;
}

.trade-type {
    display: inline-block;

    color: #666;
    font-size: 14px;
}


/* =========================
   Calculator box
========================= */

.calculator {
    padding: 34px;

    background: #ffffff;
    border: 1px solid #e1e4e8;
}


/* =========================
   Input
========================= */

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;

    margin-bottom: 9px;

    color: #333;

    font-size: 14px;
    font-weight: 600;
}

.input-with-unit {
    display: flex;
    align-items: center;

    gap: 10px;
}

.input-with-unit input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    border: 1px solid #cfd4d9;
    border-radius: 0;

    background: #ffffff;
    color: #222;

    font-size: 16px;

    outline: none;
}

.input-with-unit input:focus {
    border-color: #2f6f4e;
}

.input-with-unit span {
    flex-shrink: 0;

    color: #555;
    font-size: 14px;
}


/* =========================
   Account buttons
========================= */

.account-buttons {
    display: grid;

    grid-template-columns:
        1fr 1fr;
}

.account-button {
    height: 48px;

    border: 1px solid #cfd4d9;
    border-radius: 0;

    background: #ffffff;
    color: #333;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}

.account-button + .account-button {
    border-left: none;
}

.account-button.active {
    background: #2f6f4e;
    border-color: #2f6f4e;

    color: #ffffff;
}


/* =========================
   Shares input
========================= */

.shares-input {
    display: flex;
    align-items: center;
}


/* 株数選択 */

.shares-select-wrapper {
    position: relative;

    width: 33.333%;
}

.shares-select-wrapper::after {
    content: "";

    position: absolute;

    top: 50%;
    right: 14px;

    width: 6px;
    height: 6px;

    border-right: 1px solid #555;
    border-bottom: 1px solid #555;

    transform:
        translateY(-65%)
        rotate(45deg);

    pointer-events: none;
}

.shares-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;

    width: 100%;
    height: 48px;

    padding: 0 32px 0 14px;

    border: 1px solid #cfd4d9;
    border-right: none;
    border-radius: 0;

    background: #ffffff;
    color: #222;

    font-family: inherit;
    font-size: 16px;
    font-weight: 500;

    cursor: pointer;
    outline: none;
}

.shares-select-wrapper select:focus {
    border-color: #2f6f4e;

    position: relative;
    z-index: 1;
}


/* 株数直接入力 */

.shares-input .input-with-unit {
    flex: 1;

    gap: 10px;
}

.shares-input .input-with-unit input {
    height: 48px;
}


/* =========================
   Calculate button
========================= */

.calculate-button {
    width: 100%;
    height: 52px;

    margin-top: 8px;

    border: none;
    border-radius: 0;

    background: #222;
    color: #ffffff;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

.calculate-button:hover {
    background: #333;
}


/* =========================
   Result
========================= */

.result {
    margin-top: 32px;

    border-top: 2px solid #222;
}

.result-main {
    padding: 24px 0 28px;

    border-bottom: 1px solid #e5e7eb;
}

.result-main span {
    display: block;

    margin-bottom: 8px;

    color: #555;
    font-size: 14px;
}

.result-main strong {
    display: block;

    font-size: 38px;
    line-height: 1.2;
    font-weight: 700;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 0;

    border-bottom: 1px solid #e5e7eb;
}

.result-row span {
    color: #555;
}

.result-row strong {
    font-size: 17px;
    font-weight: 600;
}

.result .positive {
    color: #176b45;
    font-weight: 700;
}

.result .negative {
    color: #b42318;
    font-weight: 700;
}

.result-rate strong {
    font-size: 22px;
    font-weight: 700;
}

.result-profit strong {
    font-size: 20px;
    font-weight: 700;
}


/* =========================
   Footer
========================= */

.site-footer {
    padding: 30px 24px;

    border-top: 1px solid #e5e7eb;

    text-align: center;

    color: #777;
    font-size: 13px;
}


/* =========================
   Mobile
========================= */

@media (max-width: 700px) {

    main {
        padding: 40px 18px 70px;
    }

    .logo {
        padding: 18px;
    }

    .tools-section h1 {
        font-size: 26px;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .tool-card {
        min-height: 100px;
    }

    .calculator-section {
        max-width: none;
    }

    .page-heading h1 {
        font-size: 28px;
    }

    .calculator {
        padding: 24px 20px;
    }

}