* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    background-color: #F8F9FA;
    font-family: "Nunito Sans", sans-serif;
    color: #2C3E50;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* Header */

h1 {
    margin: 0 0 24px;
    font-size: 28px;
    font-weight: 600;
    color: #2D8B4E;
}

h1 img {
    vertical-align: middle;
    margin-right: 8px;
}

/* Top bar: instructions toggle + budget */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.instructions-toggle {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #2D8B4E;
    cursor: pointer;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.instructions-toggle:hover {
    color: #1f6e3a;
}

.instructions-toggle .arrow {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 12px;
}

.instructions-toggle .arrow.open {
    transform: rotate(90deg);
}

.budget-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.budget-field label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.budget-field input {
    width: 120px;
    padding: 6px 10px;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.budget-field input:focus {
    border-color: #2D8B4E;
}

/* Collapsible instructions */

.instructions {
    display: none;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.instructions.open {
    display: block;
}

.instructions pre {
    margin: 8px 0 0;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
}

/* Textarea */

.input {
    display: block;
    width: 100%;
    min-height: 200px;
    padding: 14px;
    border: 2px solid #2D8B4E;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
    border-color: #1f6e3a;
    box-shadow: 0 0 0 3px rgba(45, 139, 78, 0.15);
}

/* Generate button */

.generate {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    border: none;
    border-radius: 8px;
    background: #C8342C;
    color: #fff;
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.generate:hover {
    background: #a82a23;
}

.generate:focus {
    outline: 3px solid #D4A843;
    outline-offset: 2px;
}

/* Results */

.result {
    margin-top: 24px;
}

.result.none {
    display: none;
}

.result-heading {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
}

.result.error .result-heading {
    display: none;
}

.result.error .error-message {
    padding: 14px;
    background: #fef2f2;
    border: 1px solid #C8342C;
    border-radius: 8px;
    color: #C8342C;
    font-size: 14px;
}

.result-list {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.result-row + .result-row {
    border-top: 1px solid #e0e0e0;
}

.result-name {
    font-weight: 600;
    font-size: 15px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.btn-copy {
    padding: 6px 14px;
    border: 1px solid #2D8B4E;
    border-radius: 6px;
    background: #fff;
    color: #2D8B4E;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.btn-copy:hover {
    background: #2D8B4E;
    color: #fff;
}

.btn-copy.copied {
    background: #2D8B4E;
    color: #fff;
    border-color: #2D8B4E;
}

.btn-copy-all {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    border: 1px solid #D4A843;
    border-radius: 8px;
    background: #FFF8E7;
    color: #8B6914;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy-all:hover {
    background: #F5EDDA;
}

.btn-copy-all.copied {
    background: #2D8B4E;
    color: #fff;
    border-color: #2D8B4E;
}

@media (max-width: 480px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-actions {
        margin-left: 0;
    }
}
