@charset "UTF-8";
/* Random Grouping — gjsscと同じデザイントークン・コンポーネント語彙に合わせてある */

:root {
    --accent: #403999;
    --accent-dark: #322c7a;
    --accent-soft: #ece9fb;
    --accent-line: #d9d4f3;

    --ink: #1c1b26;
    --ink-2: #4a4857;
    --muted: #8a8796;

    --bg: #ffffff;
    --panel: #ffffff;
    --line: #e8e6ef;
    --line-2: #f2f1f7;

    --danger: #d0473f;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(28, 27, 38, .05), 0 8px 24px rgba(64, 57, 153, .06);
    --shadow-lg: 0 12px 40px rgba(64, 57, 153, .14);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- ヘッダー（このツールはログイン不要のため、ロゴだけの簡易トップバー） ---------- */
.topbar {
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top);
}
.topbar-in {
    display: flex; align-items: center; gap: 12px;
    min-height: 60px; padding: 8px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: block; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: row; align-items: baseline; gap: 4px; line-height: 1.15; white-space: nowrap; }
.brand-text strong {
    font-weight: 800; font-family: Outfit, sans-serif;
    font-size: 1.3rem; line-height: 1; letter-spacing: -.02em;
}
.brand-text small {
    display: inline-block; font-size: .9rem; font-weight: 600; color: var(--muted);
    font-family: 'Noto Sans JP', sans-serif; letter-spacing: 0; white-space: nowrap;
}

.page { flex: 1; padding: 24px 16px 48px; }

.container {
    width: 100%;
    max-width: 1000px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
}

header { margin-bottom: 24px; }

h1 {
    font-family: Outfit, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 2px;
    letter-spacing: -.02em;
}

.subtitle {
    color: var(--muted);
    font-size: .95rem;
}

/* Instructions */
.instructions-card {
    margin-bottom: 24px;
    padding: 16px 18px;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.instructions-card h3 {
    color: var(--ink);
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.instructions-card ol {
    margin-left: 20px;
    color: var(--ink-2);
}

.instructions-card li {
    margin-bottom: 8px;
    line-height: 1.7;
    font-size: .9rem;
}

.instructions-card li strong {
    color: var(--ink);
}

.instructions-note {
    margin-top: 14px;
    font-size: .82rem;
    color: var(--accent-dark);
    background: #fff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
    border: 1px solid var(--accent-line);
}

/* Forms */
.input-section {
    padding: 16px 0;
}

.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 160px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink-2);
    font-size: .82rem;
}

.help-text {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 14px;
}

textarea, input[type="number"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
    background-color: #fff;
}

textarea:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(64, 57, 153, .12);
}

textarea {
    resize: vertical;
    line-height: 1.6;
}

/* ---------- ボタン（gjsscの.btnと同じ語彙） ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    padding: 0 20px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: .9rem;
    transition: background .15s;
    height: 42px;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: transparent;
    color: var(--ink-2);
    font-weight: 600;
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    font-size: .85rem;
    transition: background .15s;
}

.btn-secondary:hover {
    background-color: var(--line-2);
}

/* Category Columns */
.category-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.category-column {
    flex: 1;
    min-width: 280px;
    background-color: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow);
    transition: border-color .15s;
}

.category-column:hover {
    border-color: var(--accent-line);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.category-name-wrapper {
    position: relative;
    flex-grow: 1;
    cursor: text;
}

.category-name-input {
    font-weight: 600;
    font-size: 1rem;
    border: 1px dashed transparent;
    background-color: transparent;
    padding: 6px 28px 6px 6px;
    width: 100%;
    border-radius: var(--radius-sm);
    transition: background-color .15s, border-color .15s;
    color: var(--ink);
}

.category-name-input:focus, .category-name-input:hover {
    border-color: var(--line);
    background-color: var(--line-2);
    outline: none;
}

.category-name-input:focus {
    border-color: var(--accent);
    border-style: solid;
}

.edit-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    cursor: pointer;
    transition: color .15s;
}

.edit-icon:hover,
.category-name-input:focus + .edit-icon {
    color: var(--accent);
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}

.btn-remove:hover {
    background-color: #fdf3f2;
    color: var(--danger);
}

.category-textarea {
    flex-grow: 1;
    min-height: 180px;
    border: none;
    background-color: var(--line-2);
}

/* Results Section */
.results-section {
    margin-top: 32px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.results-section h2 {
    font-family: Outfit, sans-serif;
    font-size: 1.25rem;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -.02em;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.group-card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.group-header {
    background: transparent;
    color: var(--ink);
    padding: 16px 16px 12px;
    font-weight: 700;
    font-size: 1.02rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.group-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-count-badge {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 1px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.btn-copy {
    background: var(--line-2);
    border: 1px solid var(--line);
    color: var(--muted);
    cursor: pointer;
    padding: 7px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
}

.btn-copy:hover {
    background: #fff;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-copy.copied {
    background: #edf9f2;
    color: #14603d;
    border-color: #c6ead8;
}

.member-list {
    list-style: none;
    padding: 6px 0;
    margin: 0;
    flex-grow: 1;
}

.member-item {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line-2);
    transition: background-color .15s;
}

.member-list > .member-item:first-child { border-top: 0; }

.member-item:hover {
    background-color: var(--line-2);
}

.member-name {
    font-weight: 500;
    color: var(--ink);
}

.member-category {
    font-size: .7rem;
    color: var(--accent);
    background-color: var(--accent-soft);
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .02em;
}

.error-message {
    margin-top: 16px;
    padding: 11px 14px;
    background-color: #fdf2f1;
    border: 1px solid #f3d3d0;
    color: #8f2d27;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hidden {
    display: none !important;
}

.foot {
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    padding: 16px 0 0;
    margin-top: auto;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary {
        width: 100%;
    }

    .category-column {
        min-width: 240px;
    }
}
