* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background: #fff;
    min-height: 100vh;
    line-height: 1.5;
    font-weight: 300;
    margin: 0;
    padding: 0;
}

.header {
    padding: 16px 16px 20px 16px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 4px;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.author-link {
    font-size: 11px;
    color: #666;
    margin: 0 0 16px 0;
    display: block;
    text-align: center;
}

.author-link a {
    color: #666;
    text-decoration: none;
}

.author-link a:hover {
    text-decoration: underline;
}

.description {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

.description p {
    font-size: 13px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 12px;
}

.description p:last-child {
    margin-bottom: 0;
}

.description .disclaimer {
    font-size: 12px;
    color: #666;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: 12px;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.left-pane {
    padding: 24px;
    overflow-y: auto;
    border-right: 1px solid #eee;
}

.right-pane {
    padding: 24px;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.diagram-header {
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

h2 {
    color: #333;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #eee;
}

.section:last-child {
    border-bottom: none;
}

/* 質問セクション */
.question {
    margin-bottom: 16px;
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

.question > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
    color: #333;
    font-size: 13px;
}

.question .note {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
    padding: 6px 10px;
    background: #f9f9f9;
    border-left: 2px solid #ddd;
    border-radius: 2px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: 300;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
    font-size: 14px;
}

.radio-group label:hover {
    background: #f5f5f5;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

input[type="number"],
input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #333;
}

.hidden {
    display: none !important;
}

/* ボタン */
.btn {
    padding: 10px 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    font-family: inherit;
}

.btn-primary {
    background: #333;
    color: white;
    border-color: #333;
}

.btn-primary:hover {
    background: #000;
    border-color: #000;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border-color: #ddd;
}

.btn-secondary:hover {
    background: #eee;
}

.action-buttons {
    margin-top: 16px;
    padding-top: 0;
    width: 100%;
    max-width: 1200px;
}

.action-buttons .btn {
    width: 100%;
}

/* 相続人フォーム */
.heir-form {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    border: 1px solid #eee;
}

.heir-form h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 400;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 6px;
    font-weight: 400;
    color: #666;
    font-size: 12px;
}

/* 一覧図 */
#diagram-container {
    background: white;
    padding: 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    overflow: auto;
    flex-shrink: 0;
    position: relative;
    min-height: 700px;
    max-height: 900px;
}

#inheritance-diagram {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
}

/* レスポンシブ */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .left-pane {
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .right-pane {
        padding: 24px;
        min-height: auto;
    }

    #diagram-container {
        max-width: 1100px;
        width: 100%;
    }

    .action-buttons {
        max-width: 1100px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 12px 16px 12px;
    }

    h1 {
        font-size: 18px;
    }

    .description {
        padding: 12px;
    }

    .description p {
        font-size: 12px;
    }

    .description .disclaimer {
        font-size: 11px;
    }

    .left-pane,
    .right-pane {
        padding: 16px;
    }

    .section {
        margin-bottom: 24px;
        padding-bottom: 24px;
    }

    #diagram-container {
        max-width: calc(100vw - 32px);
        width: 100%;
        padding: 12px;
        min-height: 400px;
    }

    .action-buttons {
        max-width: calc(100vw - 32px);
        width: 100%;
    }
}

