body{
    font-family:'Segoe UI', system-ui, sans-serif;
    background: radial-gradient(circle at top, #f8fbff 0%, #f3f6ff 30%, #eef2ff 100%);
    display:block;
    padding:0px;
    color:#0f172a;
}

.wrapper{
    max-width:2000px;
    margin: 0 auto;
}

.tool-container{
    background:#ffffffd9;
    border:1px solid rgba(99,102,241,.18);
    border-radius:20px;
    padding:16px;
    backdrop-filter: blur(8px);
    box-shadow:0 16px 40px rgba(15,23,42,.08);
    
}

.app-grid{
    display:grid;
    grid-template-columns:280px minmax(0,1fr) 340px;
    gap:14px;
    
}

.panel{
    background:#fff;
    border:1px solid #dbe4ff;
    border-radius:14px;
    padding:14px;
    overflow:auto;
}

.panel h3{
    margin:0 0 10px;
    font-size:1rem;
}

.panel-controls,
.panel-main,
.panel-history{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.control-group{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.controls-actions{
    display:flex;
    gap:8px;
    margin-top:8px;
}

.history-header h3{
    margin:0;
    font-size:1rem;
}

.history-header small{
    color:#64748b;
}

.history-list{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:10px;
}

.history-toolbar{
    margin-top:10px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.history-toolbar input{
    width:100%;
    border:1px solid #c7d2fe;
    border-radius:10px;
    padding:8px 10px;
    font-size:.88rem;
}

.history-toolbar-actions{
    display:flex;
    gap:8px;
}

.history-item{
    border:1px solid #dbe4ff;
    border-radius:10px;
    padding:8px 10px;
    background:#f8fbff;
    font-size:.86rem;
    color:#334155;
    line-height:1.4;
    word-break:break-word;
    cursor:grab;
}

.history-item.dragging-history{
    opacity:.55;
}

.history-item-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    margin-bottom:6px;
}

.history-item-name{
    font-size:.86rem;
}

.favorite-btn{
    border:1px solid #c7d2fe;
    background:#fff;
    color:#475569;
    border-radius:8px;
    padding:4px 8px;
    box-shadow:none;
    font-size:.78rem;
    cursor:pointer;
}

.favorite-btn.active{
    color:#f59e0b;
}

.history-item-text{
    margin-bottom:8px;
    font-size:.82rem;
}

.history-item-tags{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-bottom:8px;
}

.history-tag-pill{
    display:inline-flex;
    align-items:center;
    border:1px solid #c7d2fe;
    background:#eef2ff;
    color:#3730a3;
    border-radius:999px;
    padding:2px 8px;
    font-size:.72rem;
    font-weight:600;
}

.history-item-actions{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}

.history-action-btn{
    border:1px solid #c7d2fe;
    background:#ffffff;
    color:#1e293b;
    box-shadow:none;
    padding:6px 10px;
    border-radius:8px;
    font-size:.78rem;
    font-weight:600;
    cursor:pointer;
}

.history-action-btn:hover{
    transform:none;
    box-shadow:none;
    filter:brightness(0.98);
}

.btn-primary{
    margin-left:0;
}

.btn-secondary{
    background:#ffffff;
    color:#1e293b;
    border:1px solid #c7d2fe;
    box-shadow:none;
}

.btn-secondary:hover{
    box-shadow:none;
}



/* Textarea */
textarea{
    width:94%;
    min-height:180px;
    background:#ffffff;
    border:1px solid #c7d2fe;
    border-radius:12px;
    padding:14px;
    font-size:1rem;
    color:#0f172a;
    resize:none;
    transition:border-color .2s, box-shadow .2s;
}

textarea:focus{
    outline:none;
    border-color:#6366f1;
    box-shadow:0 0 0 4px rgba(99,102,241,.15);
}

/* Controls */
select,
input[type=number]{
    background:#ffffff;
    color:#0f172a;
    border:1px solid #c7d2fe;
    border-radius:10px;
    padding:9px 12px;
}

/* Buttons */
button{
    padding:10px 14px;
    border-radius:10px;
    border:none;
    cursor:pointer;
    font-weight:700;
    color:#fff;
    background:linear-gradient(135deg,#4f46e5,#6366f1);
    transition:transform .2s, box-shadow .2s, filter .2s;
    box-shadow:0 8px 18px rgba(79,70,229,.3);
}

button:hover{
    transform:translateY(-1px);
    box-shadow:0 12px 24px rgba(79,70,229,.35);
    filter:brightness(1.03);
}

/* Output */
.output{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    padding:14px;
    background:#ffffff;
    border-radius:14px;
    border:1px solid #c7d2fe;
    min-height:220px;
}

/* Word cards */
.word-card{
    cursor:grab;
    padding:9px 14px;
    border-radius:12px;
    background:linear-gradient(135deg,#2563eb,#3b82f6);
    color:#fff;
    font-weight:600;
    box-shadow:0 6px 14px rgba(37,99,235,.35);
    transition:.25s;
}

.word-card:nth-child(odd){
    background:linear-gradient(135deg,#7c3aed,#a78bfa);
}

.word-card:hover{
    transform:translateY(-2px);
}

/* Separator */
.sep-card{
    padding:8px 12px;
    border-radius:10px;
    background:linear-gradient(135deg,#06b6d4,#22d3ee);
    color:#083344;
    font-weight:700;
    box-shadow:0 4px 12px rgba(6,182,212,.35);
}

/* Drag */
.dragging{
    opacity:.6;
    transform:scale(1.08);
}

@media (max-width: 980px){
    .app-grid{
        grid-template-columns:1fr;
        height:auto;
    }

    .tool-container{
        min-height:auto;
    }
}
