* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
    color: #222;
    background: #f7f7f8;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #2f5d50;
    color: #fff;
}

.site-header .brand {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.1rem;
}

.site-header nav a,
.site-header nav span.user {
    color: #fff;
    margin-left: 1rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.site-header nav a:hover {
    text-decoration: underline;
}

.site-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

h1 {
    margin-top: 0;
}

form {
    margin: 1rem 0;
}

form label {
    display: block;
    margin-bottom: 1rem;
}

form input[type="text"],
form input[type="password"] {
    display: block;
    width: 100%;
    max-width: 320px;
    padding: 0.45rem 0.6rem;
    margin-top: 0.25rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

form input[type="text"]:focus,
form input[type="password"]:focus {
    outline: none;
    border-color: #2f5d50;
    box-shadow: 0 0 0 2px rgba(47, 93, 80, 0.2);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

button {
    padding: 0.5rem 1.25rem;
    background: #2f5d50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

button:hover {
    background: #244a40;
}

button.button-secondary {
    background: #fff;
    color: #2f5d50;
    border: 1px solid #2f5d50;
}

button.button-secondary:hover {
    background: #eef3f1;
}

.alert {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin: 0.75rem 0;
    border: 1px solid transparent;
}

.message-error,
.alert-error {
    color: #7a0015;
    background: #fdecee;
    border-color: #f3b3bb;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin: 0.75rem 0;
}

.message-success,
.alert-success {
    color: #0f5132;
    background: #e9f7ef;
    border-color: #b6e3c6;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin: 0.75rem 0;
}

.message-note {
    color: #555;
    background: #f0f0f0;
    border-color: #ddd;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin: 0.75rem 0;
    font-style: italic;
}

strong.ok {
    color: #0f5132;
}

strong.ng {
    color: #7a0015;
}

.paste-table,
.preview-table,
.result-table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.paste-table th,
.paste-table td,
.preview-table th,
.preview-table td,
.result-table th,
.result-table td {
    border: 1px solid #ccc;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    text-align: left;
}

.paste-table th,
.preview-table th,
.result-table th {
    background: #eef3f1;
}

.paste-table td {
    min-width: 80px;
    height: 1.6em;
    background: #fff;
}

.paste-table td:focus {
    outline: 2px solid #2f5d50;
    outline-offset: -2px;
}

.result-table th.select-column,
.result-table td.select-column {
    width: 3rem;
    text-align: center;
}

.result-table td button {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}
